|
6 | 6 | check: |
7 | 7 | name: Check |
8 | 8 | runs-on: ubuntu-latest |
| 9 | + env: |
| 10 | + CARGO_TERM_COLOR: always |
| 11 | + SCCACHE_GHA_ENABLED: "true" |
| 12 | + RUSTC_WRAPPER: "sccache" |
9 | 13 | steps: |
10 | | - - uses: actions/checkout@v2 |
11 | | - - uses: actions-rs/toolchain@v1 |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - uses: dtolnay/rust-toolchain@stable |
| 16 | + - uses: Swatinem/rust-cache@v2 |
12 | 17 | with: |
13 | | - profile: minimal |
14 | | - toolchain: stable |
15 | | - override: true |
16 | | - - uses: actions-rs/cargo@v1 |
17 | | - with: |
18 | | - command: check |
19 | | - args: --features webgpu |
| 18 | + shared-key: native |
| 19 | + cache-targets: false |
| 20 | + save-if: ${{ github.ref == 'refs/heads/main' }} |
| 21 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
| 22 | + - run: cargo check --features webgpu |
20 | 23 |
|
21 | 24 | check_wasm: |
22 | 25 | name: Check wasm32 |
23 | 26 | runs-on: ubuntu-latest |
| 27 | + env: |
| 28 | + CARGO_TERM_COLOR: always |
| 29 | + SCCACHE_GHA_ENABLED: "true" |
| 30 | + RUSTC_WRAPPER: "sccache" |
24 | 31 | steps: |
25 | | - - uses: actions/checkout@v2 |
26 | | - - uses: actions-rs/toolchain@v1 |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - uses: dtolnay/rust-toolchain@stable |
27 | 34 | with: |
28 | | - profile: minimal |
29 | | - toolchain: stable |
30 | | - target: wasm32-unknown-unknown |
31 | | - override: true |
32 | | - - uses: actions-rs/cargo@v1 |
| 35 | + targets: wasm32-unknown-unknown |
| 36 | + - uses: Swatinem/rust-cache@v2 |
33 | 37 | with: |
34 | | - command: check |
35 | | - args: --features webgpu --lib --target wasm32-unknown-unknown |
| 38 | + shared-key: wasm |
| 39 | + cache-targets: false |
| 40 | + save-if: ${{ github.ref == 'refs/heads/main' }} |
| 41 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
| 42 | + - run: cargo check --features webgpu --lib --target wasm32-unknown-unknown |
36 | 43 |
|
37 | 44 | test: |
38 | 45 | name: Test Suite |
39 | 46 | runs-on: ubuntu-latest |
| 47 | + env: |
| 48 | + CARGO_TERM_COLOR: always |
| 49 | + SCCACHE_GHA_ENABLED: "true" |
| 50 | + RUSTC_WRAPPER: "sccache" |
40 | 51 | steps: |
41 | | - - uses: actions/checkout@v2 |
42 | | - - uses: actions-rs/toolchain@v1 |
| 52 | + - uses: actions/checkout@v4 |
| 53 | + - uses: dtolnay/rust-toolchain@stable |
| 54 | + - uses: Swatinem/rust-cache@v2 |
43 | 55 | with: |
44 | | - profile: minimal |
45 | | - toolchain: stable |
46 | | - override: true |
| 56 | + shared-key: native |
| 57 | + cache-targets: false |
| 58 | + save-if: ${{ github.ref == 'refs/heads/main' }} |
| 59 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
47 | 60 | - run: sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev |
48 | | - - uses: actions-rs/cargo@v1 |
49 | | - with: |
50 | | - command: test |
51 | | - args: --lib |
| 61 | + - run: cargo test --lib |
52 | 62 |
|
53 | 63 | fmt: |
54 | 64 | name: Rustfmt |
55 | 65 | runs-on: ubuntu-latest |
56 | 66 | steps: |
57 | | - - uses: actions/checkout@v2 |
58 | | - - uses: actions-rs/toolchain@v1 |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + - uses: dtolnay/rust-toolchain@stable |
59 | 69 | with: |
60 | | - profile: minimal |
61 | | - toolchain: stable |
62 | | - override: true |
63 | 70 | components: rustfmt |
64 | | - - uses: actions-rs/cargo@v1 |
65 | | - with: |
66 | | - command: fmt |
67 | | - args: --all -- --check |
| 71 | + - run: cargo fmt --all -- --check |
68 | 72 |
|
69 | 73 | clippy: |
70 | 74 | name: Clippy |
71 | 75 | runs-on: ubuntu-latest |
| 76 | + env: |
| 77 | + CARGO_TERM_COLOR: always |
| 78 | + SCCACHE_GHA_ENABLED: "true" |
| 79 | + RUSTC_WRAPPER: "sccache" |
72 | 80 | steps: |
73 | | - - uses: actions/checkout@v2 |
74 | | - - uses: actions-rs/toolchain@v1 |
| 81 | + - uses: actions/checkout@v4 |
| 82 | + - uses: dtolnay/rust-toolchain@stable |
75 | 83 | with: |
76 | | - profile: minimal |
77 | | - toolchain: stable |
78 | | - override: true |
79 | 84 | components: clippy |
80 | | - - uses: actions-rs/cargo@v1 |
| 85 | + - uses: Swatinem/rust-cache@v2 |
81 | 86 | with: |
82 | | - command: clippy |
83 | | - args: -- -D warnings |
| 87 | + shared-key: native |
| 88 | + cache-targets: false |
| 89 | + save-if: ${{ github.ref == 'refs/heads/main' }} |
| 90 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
| 91 | + - run: cargo clippy -- -D warnings |
84 | 92 |
|
85 | 93 | trunk: |
86 | 94 | name: trunk |
87 | 95 | runs-on: ubuntu-latest |
| 96 | + env: |
| 97 | + CARGO_TERM_COLOR: always |
| 98 | + SCCACHE_GHA_ENABLED: "true" |
| 99 | + RUSTC_WRAPPER: "sccache" |
88 | 100 | steps: |
89 | | - - uses: actions/checkout@v2 |
90 | | - - uses: actions-rs/toolchain@v1 |
| 101 | + - uses: actions/checkout@v4 |
| 102 | + - uses: dtolnay/rust-toolchain@stable |
| 103 | + with: |
| 104 | + targets: wasm32-unknown-unknown |
| 105 | + - uses: Swatinem/rust-cache@v2 |
91 | 106 | with: |
92 | | - profile: minimal |
93 | | - toolchain: stable |
94 | | - target: wasm32-unknown-unknown |
95 | | - override: true |
| 107 | + shared-key: wasm |
| 108 | + cache-targets: false |
| 109 | + save-if: ${{ github.ref == 'refs/heads/main' }} |
| 110 | + - uses: mozilla-actions/sccache-action@v0.0.9 |
96 | 111 | - name: Download and install Trunk binary |
97 | 112 | run: wget -qO- https://github.com/trunk-rs/trunk/releases/download/v0.18.8/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- |
98 | 113 | - name: Build |
|
0 commit comments