Test MSRV on github actions

This commit is contained in:
kngwyu 2020-08-16 22:36:15 +09:00
parent 4840619d63
commit 5a098cfd13
1 changed files with 27 additions and 11 deletions

View File

@ -1,17 +1,23 @@
name: CI name: CI
on: [push, pull_request] on:
push:
branches:
- master
pull_request:
jobs: jobs:
fmt: fmt:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v1 - uses: actions/setup-python@v2
- run: pip install black==19.10b0 - run: pip install black==19.10b0
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
profile: minimal
components: rustfmt
- name: Check python formatting (black) - name: Check python formatting (black)
run: black --check . run: black --check .
- name: Check rust formatting (rustfmt) - name: Check rust formatting (rustfmt)
@ -24,14 +30,17 @@ jobs:
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
profile: minimal
components: clippy
- run: make clippy - run: make clippy
build: build:
needs: [fmt] # don't wait for clippy as fails rarely and takes longer needs: [fmt] # don't wait for clippy as fails rarely and takes longer
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }}
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
strategy: strategy:
matrix: matrix:
rust: [stable]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9-dev, pypy3] python-version: [3.5, 3.6, 3.7, 3.8, 3.9-dev, pypy3]
platform: [ platform: [
{ os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
@ -43,6 +52,12 @@ jobs:
# There is no 64-bit pypy on windows # There is no 64-bit pypy on windows
- python-version: pypy3 - python-version: pypy3
platform: { os: "windows-latest", python-architecture: "x64" } platform: { os: "windows-latest", python-architecture: "x64" }
include:
# Test minimal supported Rust version
- rust: 1.39.0
python-version: 3.8
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
msrv: "MSRV"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -56,11 +71,12 @@ jobs:
- name: Install Rust toolchain - name: Install Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: ${{ matrix.rust }}
target: ${{ matrix.platform.rust-target }} target: ${{ matrix.platform.rust-target }}
profile: minimal
- name: Prepare LD_LIBRARY_PATH (Ubuntu only) - if: matrix.platform.os == 'ubuntu-latest'
if: matrix.platform.os == 'ubuntu-latest' name: Prepare LD_LIBRARY_PATH (Ubuntu only)
run: echo ::set-env name=LD_LIBRARY_PATH::${pythonLocation}/lib run: echo ::set-env name=LD_LIBRARY_PATH::${pythonLocation}/lib
- run: rustup set default-host ${{ matrix.platform.rust-target }} - run: rustup set default-host ${{ matrix.platform.rust-target }}
@ -100,22 +116,22 @@ jobs:
needs: [fmt] needs: [fmt]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly toolchain: nightly
override: true override: true
profile: minimal
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: test command: test
args: --features "num-bigint num-complex" --no-fail-fast args: --features "num-bigint num-complex" --no-fail-fast
env: env:
CARGO_INCREMENTAL: '0' CARGO_INCREMENTAL: 0
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
- uses: actions-rs/grcov@v0.1 - uses: actions-rs/grcov@v0.1
id: coverage id: coverage
- run: echo ${{ steps.coverage.outputs.report }}
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v1
with: with:
file: ${{ steps.coverage.outputs.report }} file: ${{ steps.coverage.outputs.report }}