|
| 1 | +on: |
| 2 | + push: |
| 3 | + branches: |
| 4 | + - main |
| 5 | + pull_request: |
| 6 | + |
| 7 | +name: Continuous integration |
| 8 | + |
| 9 | +jobs: |
| 10 | + check: |
| 11 | + name: Check |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest, windows-latest, macOS-latest] |
| 16 | + rust: [stable] |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - uses: actions/setup-python@v5 |
| 20 | + with: |
| 21 | + python-version: "3.11" |
| 22 | + - uses: actions-rs/toolchain@v1 |
| 23 | + with: |
| 24 | + profile: minimal |
| 25 | + toolchain: ${{ matrix.rust }} |
| 26 | + override: true |
| 27 | + - uses: actions-rs/cargo@v1 |
| 28 | + with: |
| 29 | + command: check |
| 30 | + args: --workspace |
| 31 | + |
| 32 | + test: |
| 33 | + name: Test Suite |
| 34 | + runs-on: ${{ matrix.os }} |
| 35 | + strategy: |
| 36 | + matrix: |
| 37 | + os: [ubuntu-latest, windows-latest, macOS-latest] |
| 38 | + rust: [stable] |
| 39 | + steps: |
| 40 | + - name: Delete huge unnecessary tools folder |
| 41 | + if: runner.os == 'Linux' |
| 42 | + run: rm -rf /opt/hostedtoolcache |
| 43 | + - uses: actions/checkout@v4 |
| 44 | + - uses: actions/setup-python@v5 |
| 45 | + with: |
| 46 | + python-version: "3.11" |
| 47 | + - uses: actions-rs/toolchain@v1 |
| 48 | + with: |
| 49 | + profile: minimal |
| 50 | + toolchain: ${{ matrix.rust }} |
| 51 | + override: true |
| 52 | + - uses: actions-rs/cargo@v1 |
| 53 | + with: |
| 54 | + command: test |
| 55 | + args: --workspace |
| 56 | + |
| 57 | + fmt: |
| 58 | + name: Rustfmt |
| 59 | + runs-on: ubuntu-latest |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v4 |
| 62 | + - uses: actions-rs/toolchain@v1 |
| 63 | + with: |
| 64 | + profile: minimal |
| 65 | + toolchain: stable |
| 66 | + override: true |
| 67 | + - run: rustup component add rustfmt |
| 68 | + - uses: actions-rs/cargo@v1 |
| 69 | + with: |
| 70 | + command: fmt |
| 71 | + args: --all -- --check |
| 72 | + |
| 73 | + clippy: |
| 74 | + name: Clippy |
| 75 | + runs-on: ubuntu-latest |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + - uses: actions-rs/toolchain@v1 |
| 79 | + with: |
| 80 | + profile: minimal |
| 81 | + toolchain: stable |
| 82 | + override: true |
| 83 | + - run: rustup component add clippy |
| 84 | + - uses: actions-rs/cargo@v1 |
| 85 | + with: |
| 86 | + command: clippy |
| 87 | + args: --workspace --tests --examples -- -D warnings |
0 commit comments