|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build: |
13 | | - name: Build & Test |
14 | | - runs-on: ubuntu-22.04 |
| 13 | + name: Build |
| 14 | + runs-on: ubuntu-latest |
15 | 15 | steps: |
16 | 16 | - name: Checkout the repository |
17 | 17 | uses: actions/checkout@v4 |
18 | | - |
19 | 18 | - name: Install Rust toolchain |
20 | 19 | uses: dtolnay/rust-toolchain@stable |
21 | | - with: |
22 | | - targets: x86_64-unknown-linux-gnu |
23 | | - components: rustfmt, clippy |
24 | | - |
25 | 20 | - name: Cache Cargo dependencies |
26 | | - uses: actions/cache@v4 |
27 | | - with: |
28 | | - path: | |
29 | | - ~/.cargo/bin/ |
30 | | - ~/.cargo/registry/index/ |
31 | | - ~/.cargo/registry/cache/ |
32 | | - ~/.cargo/git/db/ |
33 | | - target/ |
34 | | - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
35 | | - |
36 | | - - name: Check the formatting |
37 | | - uses: actions-rs/cargo@v1 |
38 | | - with: |
39 | | - command: fmt |
40 | | - args: -- --check --verbose |
41 | | - |
| 21 | + uses: Swatinem/rust-cache@v2 |
42 | 22 | - name: Build the project |
43 | | - uses: actions-rs/cargo@v1 |
| 23 | + run: cargo check --locked --verbose |
| 24 | + lint-formatting: |
| 25 | + name: Lint Formatting |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - name: Checkout the repository |
| 29 | + uses: actions/checkout@v4 |
| 30 | + - name: Install Rust toolchain |
| 31 | + uses: dtolnay/rust-toolchain@stable |
44 | 32 | with: |
45 | | - command: check |
46 | | - args: --locked --verbose |
47 | | - |
48 | | - - name: Check the lints |
49 | | - uses: actions-rs/cargo@v1 |
| 33 | + components: rustfmt |
| 34 | + - name: Cache Cargo dependencies |
| 35 | + uses: Swatinem/rust-cache@v2 |
| 36 | + - name: Check formatting |
| 37 | + run: cargo fmt --check |
| 38 | + lint-clippy: |
| 39 | + name: Lint Clippy |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - name: Checkout the repository |
| 43 | + uses: actions/checkout@v4 |
| 44 | + - name: Install Rust toolchain |
| 45 | + uses: dtolnay/rust-toolchain@stable |
50 | 46 | with: |
51 | | - command: clippy |
52 | | - args: --tests --verbose -- -D warnings |
53 | | - |
| 47 | + components: clippy |
| 48 | + - name: Cache Cargo dependencies |
| 49 | + uses: Swatinem/rust-cache@v2 |
| 50 | + - name: Check Clippy lints |
| 51 | + run: cargo clippy --tests -- -D warnings |
0 commit comments