on master help sign in
Replace handwritten CI cache with Swatinem/rust-cache
35303f7Blaž Hrastnik
.github/workflows/build.yml+4−80
@@ -22,26 +22,7 @@ jobs:
22 toolchain: stable
22 toolchain: stable
23 override: true
23 override: true
24
24
25− - name: Cache cargo registry
25+ - uses: Swatinem/rust-cache@v1
26− uses: actions/cache@v3
27− with:
28− path: ~/.cargo/registry
29− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
30− restore-keys: ${{ runner.os }}-v2-cargo-registry-
31−
32− - name: Cache cargo index
33− uses: actions/cache@v3
34− with:
35− path: ~/.cargo/git
36− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
37− restore-keys: ${{ runner.os }}-v2-cargo-index-
38−
39− - name: Cache cargo target dir
40− uses: actions/cache@v3
41− with:
42− path: target
43− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
44− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
45
26
46 - name: Run cargo check
27 - name: Run cargo check
47 uses: actions-rs/cargo@v1
28 uses: actions-rs/cargo@v1
@@ -62,26 +43,7 @@ jobs:
62 toolchain: ${{ matrix.rust }}
43 toolchain: ${{ matrix.rust }}
63 override: true
44 override: true
64
45
65− - name: Cache cargo registry
46+ - uses: Swatinem/rust-cache@v1
66− uses: actions/cache@v3
67− with:
68− path: ~/.cargo/registry
69− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
70− restore-keys: ${{ runner.os }}-v2-cargo-registry-
71−
72− - name: Cache cargo index
73− uses: actions/cache@v3
74− with:
75− path: ~/.cargo/git
76− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
77− restore-keys: ${{ runner.os }}-v2-cargo-index-
78−
79− - name: Cache cargo target dir
80− uses: actions/cache@v3
81− with:
82− path: target
83− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
84− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
85
47
86 - name: Copy minimal languages config
48 - name: Copy minimal languages config
87 run: cp .github/workflows/languages.toml ./languages.toml
49 run: cp .github/workflows/languages.toml ./languages.toml
@@ -119,26 +81,7 @@ jobs:
119 override: true
81 override: true
120 components: rustfmt, clippy
82 components: rustfmt, clippy
121
83
122− - name: Cache cargo registry
84+ - uses: Swatinem/rust-cache@v1
123− uses: actions/cache@v3
124− with:
125− path: ~/.cargo/registry
126− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
127− restore-keys: ${{ runner.os }}-v2-cargo-registry-
128−
129− - name: Cache cargo index
130− uses: actions/cache@v3
131− with:
132− path: ~/.cargo/git
133− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
134− restore-keys: ${{ runner.os }}-v2-cargo-index-
135−
136− - name: Cache cargo target dir
137− uses: actions/cache@v3
138− with:
139− path: target
140− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
141− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
142
85
143 - name: Run cargo fmt
86 - name: Run cargo fmt
144 uses: actions-rs/cargo@v1
87 uses: actions-rs/cargo@v1
@@ -166,26 +109,7 @@ jobs:
166 toolchain: stable
109 toolchain: stable
167 override: true
110 override: true
168
111
169− - name: Cache cargo registry
112+ - uses: Swatinem/rust-cache@v1
170− uses: actions/cache@v3
171− with:
172− path: ~/.cargo/registry
173− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
174− restore-keys: ${{ runner.os }}-v2-cargo-registry-
175−
176− - name: Cache cargo index
177− uses: actions/cache@v3
178− with:
179− path: ~/.cargo/git
180− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
181− restore-keys: ${{ runner.os }}-v2-cargo-index-
182−
183− - name: Cache cargo target dir
184− uses: actions/cache@v3
185− with:
186− path: target
187− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
188− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
189
113
190 - name: Generate docs
114 - name: Generate docs
191 uses: actions-rs/cargo@v1
115 uses: actions-rs/cargo@v1
.github/workflows/release.yml+1−20
@@ -20,26 +20,7 @@ jobs:
20 toolchain: stable
20 toolchain: stable
21 override: true
21 override: true
22
22
23− - name: Cache cargo registry
23+ - uses: Swatinem/rust-cache@v1
24− uses: actions/cache@v3
25− with:
26− path: ~/.cargo/registry
27− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
28− restore-keys: ${{ runner.os }}-v2-cargo-registry-
29−
30− - name: Cache cargo index
31− uses: actions/cache@v3
32− with:
33− path: ~/.cargo/git
34− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
35− restore-keys: ${{ runner.os }}-v2-cargo-index-
36−
37− - name: Cache cargo target dir
38− uses: actions/cache@v3
39− with:
40− path: target
41− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
42− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
43
24
44 - name: Fetch tree-sitter grammars
25 - name: Fetch tree-sitter grammars
45 uses: actions-rs/cargo@v1
26 uses: actions-rs/cargo@v1