|
| 1 | +name: ci |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: {} |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +jobs: |
| 10 | + |
| 11 | + commitsar: |
| 12 | + name: Verify commit messages |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Check out code |
| 16 | + uses: actions/checkout@v1 |
| 17 | + - name: Run commitsar |
| 18 | + uses: docker://commitsar/commitsar |
| 19 | + |
| 20 | + pre-commit: |
| 21 | + name: Generic pre-commit checks |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v2 |
| 25 | + with: |
| 26 | + fetch-depth: 1 |
| 27 | + |
| 28 | + - uses: actions/setup-python@v2 |
| 29 | + with: |
| 30 | + python-version: 3.7 |
| 31 | + |
| 32 | + - run: pip install pre-commit |
| 33 | + - run: pre-commit run --all-files |
| 34 | + |
| 35 | + check: |
| 36 | + name: Check |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v2 |
| 40 | + - uses: actions-rs/toolchain@v1 |
| 41 | + with: |
| 42 | + profile: minimal |
| 43 | + toolchain: stable |
| 44 | + override: true |
| 45 | + - uses: actions-rs/cargo@v1 |
| 46 | + with: |
| 47 | + command: check |
| 48 | + |
| 49 | + test-stable: |
| 50 | + name: Test (stable) |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + with: |
| 55 | + submodules: true |
| 56 | + |
| 57 | + - uses: actions/setup-python@v2 |
| 58 | + with: |
| 59 | + python-version: 3.7 |
| 60 | + |
| 61 | + - uses: actions-rs/toolchain@v1 |
| 62 | + with: |
| 63 | + profile: minimal |
| 64 | + toolchain: stable |
| 65 | + override: true |
| 66 | + - uses: actions-rs/cargo@v1 |
| 67 | + with: |
| 68 | + command: test |
| 69 | + args: --no-fail-fast |
| 70 | + |
| 71 | + test-nightly: |
| 72 | + name: Test + Coverage (nightly) |
| 73 | + runs-on: ubuntu-latest |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v2 |
| 76 | + with: |
| 77 | + submodules: true |
| 78 | + - uses: actions/setup-python@v2 |
| 79 | + with: |
| 80 | + python-version: 3.7 |
| 81 | + - uses: actions-rs/toolchain@v1 |
| 82 | + with: |
| 83 | + toolchain: nightly |
| 84 | + override: true |
| 85 | + - uses: actions-rs/cargo@v1 |
| 86 | + with: |
| 87 | + command: clean |
| 88 | + - uses: actions-rs/cargo@v1 |
| 89 | + with: |
| 90 | + command: test |
| 91 | + args: --no-fail-fast |
| 92 | + env: |
| 93 | + CARGO_INCREMENTAL: '0' |
| 94 | + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' |
| 95 | + RUSTDOCFLAGS: '-Cpanic=abort' |
| 96 | + - id: coverage |
| 97 | + uses: actions-rs/[email protected] |
| 98 | + - name: Upload coverage to Codecov |
| 99 | + |
| 100 | + with: |
| 101 | + name: coverage |
| 102 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 103 | + file: ${{ steps.coverage.outputs.report }} |
| 104 | + |
| 105 | + fmt: |
| 106 | + name: Rustfmt |
| 107 | + runs-on: ubuntu-latest |
| 108 | + steps: |
| 109 | + - uses: actions/checkout@v2 |
| 110 | + - uses: actions-rs/toolchain@v1 |
| 111 | + with: |
| 112 | + profile: minimal |
| 113 | + toolchain: stable |
| 114 | + override: true |
| 115 | + - run: rustup component add rustfmt |
| 116 | + - uses: actions-rs/cargo@v1 |
| 117 | + with: |
| 118 | + command: fmt |
| 119 | + args: --all -- --check |
| 120 | + |
| 121 | + clippy: |
| 122 | + name: Clippy |
| 123 | + runs-on: ubuntu-latest |
| 124 | + steps: |
| 125 | + - uses: actions/checkout@v2 |
| 126 | + - uses: actions-rs/toolchain@v1 |
| 127 | + with: |
| 128 | + profile: minimal |
| 129 | + toolchain: stable |
| 130 | + override: true |
| 131 | + - run: rustup component add clippy |
| 132 | + - uses: actions-rs/cargo@v1 |
| 133 | + with: |
| 134 | + command: clippy |
| 135 | + args: -- -D warnings |
0 commit comments