|
1 | 1 | name: Automated Testing |
2 | 2 |
|
3 | | -on: push |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["*"] |
4 | 6 |
|
5 | 7 | env: |
6 | 8 | CARGO_TERM_COLOR: always |
7 | 9 |
|
8 | 10 | jobs: |
9 | | - check: |
10 | | - name: Check |
| 11 | + clippy: |
11 | 12 | runs-on: ubuntu-latest |
12 | 13 | steps: |
13 | | - - uses: actions/checkout@v2 |
14 | | - - uses: actions-rs/toolchain@v1 |
15 | | - with: |
16 | | - profile: minimal |
17 | | - toolchain: stable |
18 | | - override: true |
19 | | - - uses: actions-rs/cargo@v1 |
20 | | - with: |
21 | | - command: check |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4 |
22 | 16 |
|
23 | | - test: |
24 | | - name: Test Suite |
25 | | - runs-on: ubuntu-latest |
26 | | - steps: |
27 | | - - uses: actions/checkout@v2 |
28 | | - - uses: actions-rs/toolchain@v1 |
| 17 | + - name: Set up cache |
| 18 | + uses: actions/cache@v3 |
29 | 19 | with: |
30 | | - profile: minimal |
31 | | - toolchain: stable |
32 | | - override: true |
33 | | - - uses: actions-rs/cargo@v1 |
34 | | - with: |
35 | | - command: test |
| 20 | + path: | |
| 21 | + ~/.cargo/.crates.toml |
| 22 | + ~/.cargo/.crates2.json |
| 23 | + ~/.cargo/bin/ |
| 24 | + ~/.cargo/registry/index/ |
| 25 | + ~/.cargo/registry/cache/ |
| 26 | + ~/.cargo/git/db/ |
| 27 | + ~/.rustup/toolchains/ |
| 28 | + target/ |
| 29 | + key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} |
| 30 | + |
| 31 | + - name: Install WASM toolchain |
| 32 | + run: rustup target add wasm32-unknown-unknown |
| 33 | + |
| 34 | + - name: Check project |
| 35 | + run: cargo clippy --workspace --all-targets --all-features -- -D warnings |
36 | 36 |
|
37 | | - format: |
38 | | - name: Format |
| 37 | + - name: Check project (WASM) |
| 38 | + # Note lack of --all-targets here because tests and examples are not wasm compatible |
| 39 | + run: cargo clippy --workspace --all-features --target wasm32-unknown-unknown -- -D warnings |
| 40 | + |
| 41 | + clippy-stable: |
39 | 42 | runs-on: ubuntu-latest |
40 | 43 | steps: |
41 | | - - uses: actions/checkout@v2 |
42 | | - - uses: actions-rs/toolchain@v1 |
43 | | - with: |
44 | | - profile: minimal |
45 | | - toolchain: stable |
46 | | - override: true |
47 | | - components: rustfmt |
48 | | - - uses: actions-rs/cargo@v1 |
| 44 | + - name: Checkout |
| 45 | + uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Set up cache |
| 48 | + uses: actions/cache@v3 |
49 | 49 | with: |
50 | | - command: fmt |
51 | | - args: --all -- --check |
| 50 | + path: | |
| 51 | + ~/.cargo/.crates.toml |
| 52 | + ~/.cargo/.crates2.json |
| 53 | + ~/.cargo/bin/ |
| 54 | + ~/.cargo/registry/index/ |
| 55 | + ~/.cargo/registry/cache/ |
| 56 | + ~/.cargo/git/db/ |
| 57 | + ~/.rustup/toolchains/ |
| 58 | + target/ |
| 59 | + key: ${{ runner.os }}-cargo-check-stable-${{ hashFiles('**/Cargo.lock') }} |
52 | 60 |
|
53 | | - clippy: |
54 | | - name: Clippy |
| 61 | + - name: Install stable toolchain |
| 62 | + run: rustup toolchain install stable |
| 63 | + |
| 64 | + - name: Install WASM toolchain |
| 65 | + run: rustup target add wasm32-unknown-unknown --toolchain stable |
| 66 | + |
| 67 | + - name: Check on stable |
| 68 | + run: cargo +stable clippy --all-targets -- -D warnings |
| 69 | + |
| 70 | + - name: Check project (WASM) on stable |
| 71 | + # Note lack of --all-targets here because tests and examples are not wasm compatible |
| 72 | + run: cargo +stable clippy --target wasm32-unknown-unknown -- -D warnings |
| 73 | + |
| 74 | + test: |
55 | 75 | runs-on: ubuntu-latest |
56 | 76 | steps: |
57 | | - - uses: actions/checkout@v2 |
58 | | - - uses: actions-rs/toolchain@v1 |
59 | | - with: |
60 | | - profile: minimal |
61 | | - toolchain: stable |
62 | | - override: true |
63 | | - components: clippy |
64 | | - - uses: actions-rs/cargo@v1 |
| 77 | + - name: Checkout |
| 78 | + uses: actions/checkout@v4 |
| 79 | + |
| 80 | + - name: Set up cache |
| 81 | + uses: actions/cache@v3 |
65 | 82 | with: |
66 | | - command: clippy |
67 | | - args: -- -D warnings |
| 83 | + path: | |
| 84 | + ~/.cargo/.crates.toml |
| 85 | + ~/.cargo/.crates2.json |
| 86 | + ~/.cargo/bin/ |
| 87 | + ~/.cargo/registry/index/ |
| 88 | + ~/.cargo/registry/cache/ |
| 89 | + ~/.cargo/git/db/ |
| 90 | + ~/.rustup/toolchains/ |
| 91 | + target/ |
| 92 | + key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} |
| 93 | + |
| 94 | + - name: Test project |
| 95 | + run: RUST_BACKTRACE=1 cargo test --workspace --all-targets --all-features |
0 commit comments