| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | push: |
| 6 | branches: |
| 7 | - master |
| 8 | schedule: |
| 9 | - cron: "0 2 * * 1" |
| 10 | |
| 11 | env: |
| 12 | CARGO_TERM_COLOR: always |
| 13 | RUST_BACKTRACE: 1 |
| 14 | |
| 15 | jobs: |
| 16 | check: |
| 17 | name: Check |
| 18 | runs-on: ubuntu-latest |
| 19 | steps: |
| 20 | - name: Checkout sources |
| 21 | uses: actions/checkout@v4 |
| 22 | |
| 23 | - name: Install stable toolchain |
| 24 | uses: dtolnay/rust-toolchain@stable |
| 25 | |
| 26 | - name: Install dependencies |
| 27 | run: | |
| 28 | sudo apt-get update -y -qq |
| 29 | |
| 30 | - name: Run cargo check |
| 31 | run: cargo check |
| 32 | |
| 33 | test: |
| 34 | name: Test Suite |
| 35 | runs-on: ubuntu-latest |
| 36 | steps: |
| 37 | - name: Checkout sources |
| 38 | uses: actions/checkout@v4 |
| 39 | |
| 40 | - name: Install stable toolchain |
| 41 | uses: dtolnay/rust-toolchain@stable |
| 42 | |
| 43 | - name: Install dependencies |
| 44 | run: | |
| 45 | sudo apt-get update -y -qq |
| 46 | |
| 47 | - name: Run cargo test |
| 48 | run: cargo test --verbose |
| 49 | |
| 50 | clippy: |
| 51 | name: Lint with clippy |
| 52 | runs-on: ubuntu-latest |
| 53 | env: |
| 54 | RUSTFLAGS: -Dwarnings |
| 55 | steps: |
| 56 | - name: Checkout sources |
| 57 | uses: actions/checkout@v4 |
| 58 | |
| 59 | - name: Install stable toolchain |
| 60 | uses: dtolnay/rust-toolchain@stable |
| 61 | |
| 62 | - name: Install dependencies |
| 63 | run: | |
| 64 | sudo apt-get update -y -qq |
| 65 | |
| 66 | - name: Run cargo clippy |
| 67 | run: cargo clippy --workspace --all-targets --verbose -- -A dead-code |
| 68 | |
| 69 | rustfmt: |
| 70 | name: Verify code formatting |
| 71 | runs-on: ubuntu-latest |
| 72 | env: |
| 73 | RUSTFLAGS: -Dwarnings |
| 74 | steps: |
| 75 | - name: Checkout sources |
| 76 | uses: actions/checkout@v4 |
| 77 | |
| 78 | - name: Install stable toolchain |
| 79 | uses: dtolnay/rust-toolchain@stable |
| 80 | |
| 81 | - name: Install dependencies |
| 82 | run: | |
| 83 | sudo apt-get update -y -qq |
| 84 | |
| 85 | - name: Run cargo clippy |
| 86 | run: cargo fmt --all -- --check |