Skip to content

Commit 710a1e2

Browse files
use new setup-rust-toolchain action
1 parent 25b05ff commit 710a1e2

File tree

1 file changed

+13
-35
lines changed

1 file changed

+13
-35
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,6 @@ jobs:
105105
- name: Checkout
106106
uses: actions/checkout@v4
107107

108-
- name: Cache
109-
uses: actions/cache@v4
110-
with:
111-
path: |
112-
~/.cargo/registry
113-
~/.cargo/git
114-
./target
115-
key: ${{ matrix.target }}-${{ github.sha }}
116-
restore-keys: |
117-
${{ matrix.target }}-${{ github.sha }}
118-
${{ matrix.target }}-
119-
120108
- name: Setup cross compiling (Debian)
121109
id: cross_compile
122110
if: contains(matrix.os, 'ubuntu') && matrix.container == null
@@ -278,34 +266,24 @@ jobs:
278266
gettext-dev
279267
echo "::endgroup::"
280268
281-
- name: Setup Rust (Unix)
282-
if: ${{ !contains(matrix.os, 'windows') }}
283-
run: |
284-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
285-
source $HOME/.cargo/env
286-
287-
# print rust version
288-
rustc --version
289-
290-
- name: Install cargo dependencies
291-
run: |
292-
# cargo-bin --install doesn't work without a lock file
293-
# https://github.com/dustinblackman/cargo-run-bin/issues/27
294-
# cargo install cargo-run-bin
295-
# cargo-bin --install
296-
297-
cargo install cargo-edit
298-
cargo install cargo-tarpaulin
269+
# TODO: it may be possible to use cargo-bin in the future to install cargo dependencies,
270+
# but right now it doesn't work without a lock file
271+
# https://github.com/dustinblackman/cargo-run-bin/issues/27
272+
# cargo install cargo-run-bin
273+
# cargo-bin --install
274+
- name: Setup Rust
275+
uses: ReenigneArcher/setup-rust-toolchain@feat/install-cargo-packages
276+
with:
277+
target: ${{ matrix.target }}
278+
components: 'clippy'
279+
cargo-packages: 'cargo-edit,cargo-tarpaulin'
280+
cache: true
281+
cache-on-failure: false
299282

300283
- name: Update Version
301284
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
302285
run: cargo set-version ${{ needs.setup_release.outputs.release_version }}
303286

304-
- name: Install toolchain
305-
run: |
306-
${{ matrix.cargo_env }}
307-
rustup target add ${{ matrix.target }}
308-
309287
- name: Test
310288
id: test
311289
run: |

0 commit comments

Comments
 (0)