|
| 1 | +# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md |
| 2 | + |
| 3 | +name: CI |
| 4 | + |
| 5 | +on: [push, pull_request] |
| 6 | + |
| 7 | +jobs: |
| 8 | + check: |
| 9 | + name: Check |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + toolchain: [stable, beta, nightly] |
| 14 | + steps: |
| 15 | + - name: Checkout sources |
| 16 | + uses: actions/checkout@v2 |
| 17 | + |
| 18 | + - name: Install ${{ matrix.toolchain }} toolchain |
| 19 | + uses: actions-rs/toolchain@v1 |
| 20 | + with: |
| 21 | + profile: minimal |
| 22 | + toolchain: ${{ matrix.toolchain }} |
| 23 | + override: true |
| 24 | + |
| 25 | + - name: Run cargo check |
| 26 | + uses: actions-rs/cargo@v1 |
| 27 | + with: |
| 28 | + command: check |
| 29 | + args: --all-features --all |
| 30 | + |
| 31 | + test: |
| 32 | + name: Test Suite |
| 33 | + runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + toolchain: [stable, beta, nightly] |
| 37 | + steps: |
| 38 | + - name: Checkout sources |
| 39 | + uses: actions/checkout@v2 |
| 40 | + |
| 41 | + - name: Install ${{ matrix.toolchain }} toolchain |
| 42 | + uses: actions-rs/toolchain@v1 |
| 43 | + with: |
| 44 | + profile: minimal |
| 45 | + toolchain: ${{ matrix.toolchain }} |
| 46 | + override: true |
| 47 | + |
| 48 | + - name: Run cargo test |
| 49 | + uses: actions-rs/cargo@v1 |
| 50 | + with: |
| 51 | + command: test |
| 52 | + args: --all-features --all |
| 53 | + |
| 54 | + lints: |
| 55 | + name: Lints |
| 56 | + runs-on: ubuntu-latest |
| 57 | + strategy: |
| 58 | + matrix: |
| 59 | + toolchain: [stable, beta, nightly] |
| 60 | + steps: |
| 61 | + - name: Checkout sources |
| 62 | + uses: actions/checkout@v2 |
| 63 | + |
| 64 | + - name: Install ${{ matrix.toolchain }} toolchain |
| 65 | + uses: actions-rs/toolchain@v1 |
| 66 | + with: |
| 67 | + profile: minimal |
| 68 | + toolchain: ${{ matrix.toolchain }} |
| 69 | + override: true |
| 70 | + components: rustfmt, clippy |
| 71 | + |
| 72 | + - name: Run cargo fmt |
| 73 | + uses: actions-rs/cargo@v1 |
| 74 | + with: |
| 75 | + command: fmt |
| 76 | + args: --all -- --check |
| 77 | + |
| 78 | + - name: Run cargo clippy |
| 79 | + uses: actions-rs/cargo@v1 |
| 80 | + with: |
| 81 | + command: clippy |
| 82 | + args: --all-features --all -- -D warnings |
| 83 | + |
| 84 | + grcov: |
| 85 | + name: Coverage |
| 86 | + runs-on: ubuntu-latest |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v2 |
| 89 | + |
| 90 | + - name: Install toolchain |
| 91 | + uses: actions-rs/toolchain@v1 |
| 92 | + with: |
| 93 | + toolchain: nightly |
| 94 | + override: true |
| 95 | + |
| 96 | + - name: Execute tests |
| 97 | + uses: actions-rs/cargo@v1 |
| 98 | + with: |
| 99 | + command: test |
| 100 | + args: --all --all-features |
| 101 | + env: |
| 102 | + CARGO_INCREMENTAL: 0 |
| 103 | + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" |
| 104 | + RUSTDOCFLAGS: "-Cpanic=abort" |
| 105 | + |
| 106 | + - name: Gather coverage data |
| 107 | + id: coverage |
| 108 | + uses: actions-rs/grcov@v0.1 |
| 109 | + |
| 110 | + - name: Coveralls upload |
| 111 | + uses: coverallsapp/github-action@master |
| 112 | + with: |
| 113 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + parallel: true |
| 115 | + path-to-lcov: ${{ steps.coverage.outputs.report }} |
| 116 | + |
| 117 | + grcov_finalize: |
| 118 | + runs-on: ubuntu-latest |
| 119 | + needs: grcov |
| 120 | + steps: |
| 121 | + - name: Coveralls finalization |
| 122 | + uses: coverallsapp/github-action@master |
| 123 | + with: |
| 124 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 125 | + parallel-finished: true |
0 commit comments