@@ -36,22 +36,12 @@ jobs:
36
36
uses :
bevyengine/bevy/.github/actions/[email protected]
37
37
38
38
- name : Cache build artifacts
39
- uses : Leafwing-Studios/cargo -cache@v2
39
+ uses : Swatinem/rust -cache@v2
40
40
with :
41
- sweep-cache : true
42
-
43
- # We have a separate workspace where we execute the CLI in the E2E tests
44
- # It has it's own `target` folder, hence we need to cache it separately
45
- - name : Cache test workspace
46
- uses : Leafwing-Studios/cargo-cache@v2
47
- with :
48
- sweep-cache : true
49
- # The cache-group needs to be different to not collide with the cache for the test executing itself
50
- cache-group : " test_workspace-${{ hashFiles(env.workflow_path) }}-${{ github.job }}-${{ strategy.job-index }}"
51
- # cargo-cache doesn't support `working-directory` yet, we have to do it manually
52
- # See https://github.com/Leafwing-Studios/cargo-cache/issues/44
53
- cargo-target-dir : ./tests/bevy_cli_test/target
54
- manifest-path : ./tests/bevy_cli_test/Cargo.toml
41
+ workspaces : |
42
+ . -> target
43
+ tests/bevy_cli_test -> target
44
+ save-if : ${{ github.ref == 'refs/heads/main' }}
55
45
56
46
- name : Run tests
57
47
run : |
78
68
components : " ${{ needs.extract-rust-version.outputs.components }}, clippy"
79
69
80
70
- name : Cache build artifacts
81
- uses : Leafwing-Studios/cargo -cache@v2
71
+ uses : Swatinem/rust -cache@v2
82
72
with :
83
- sweep-cache : true
73
+ # All 3 matrix combinations share the same cache key, so we only save the cache for the
74
+ # combination that does the most work. In this case, that's `--all-features`.
75
+ save-if : ${{ github.ref == 'refs/heads/main' && matrix.features == '--all-features' }}
84
76
85
77
- name : Run Clippy
86
78
env :
@@ -120,9 +112,9 @@ jobs:
120
112
components : ${{ needs.extract-rust-version.outputs.components }}
121
113
122
114
- name : Cache build artifacts
123
- uses : Leafwing-Studios/cargo -cache@v2
115
+ uses : Swatinem/rust -cache@v2
124
116
with :
125
- sweep-cache : true
117
+ save-if : ${{ github.ref == 'refs/heads/main' }}
126
118
127
119
- name : Build documentation
128
120
run : cargo doc --workspace --all-features --document-private-items --no-deps
0 commit comments