Skip to content

Commit c306289

Browse files
committed
fix: Clean up the GH Actions workflows
1 parent 537880c commit c306289

File tree

2 files changed

+12
-36
lines changed

2 files changed

+12
-36
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,13 @@ jobs:
2020
os: [ubuntu-latest, windows-latest, macos-latest]
2121
steps:
2222
- uses: actions/checkout@v4
23-
- name: Cache Rust dependencies
24-
uses: actions/cache@v3
23+
- name: Set up cargo cache
24+
uses: Swatinem/rust-cache@v2
25+
if: github.ref != 'refs/heads/main'
2526
with:
26-
path: |
27-
~/.cargo
28-
target
29-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-cargo-
32-
- name: Set up Rust toolchain version
33-
run: |
34-
if [ ! -f rust-toolchain.toml ]; then
35-
echo "Error: rust-toolchain.toml file not found!" >&2
36-
exit 1
37-
fi
38-
TOOLCHAIN_VERSION=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f2)
39-
echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV
40-
- name: Install Rust toolchain
41-
run: |
42-
rustup set profile minimal
43-
rustup install "$TOOLCHAIN_VERSION"
44-
rustup default "$TOOLCHAIN_VERSION"
45-
rustup component add rustfmt clippy llvm-tools-preview rustc-dev
46-
rustup show
27+
prefix-key: "andromeda-${{ runner.os }}"
28+
- name: Install the rust toolchain
29+
uses: dtolnay/rust-toolchain@stable
4730
- name: Test
4831
run: cargo test
4932
timeout-minutes: 20
@@ -54,4 +37,4 @@ jobs:
5437
- name: Clippy
5538
run: |
5639
cargo clippy --all-targets -- -D warnings
57-
cargo +$TOOLCHAIN_VERSION clippy --all-targets --all-features -- -D warnings
40+
cargo clippy --all-targets --all-features -- -D warnings

.github/workflows/release.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,14 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v3
3939

40-
- name: Install Rust
41-
uses: actions-rs/toolchain@v1
40+
- name: Install the rust toolchain
41+
uses: dtolnay/rust-toolchain@stable
4242
with:
43-
profile: minimal
44-
toolchain: stable
45-
override: true
46-
target: ${{ matrix.rust-target }}
47-
48-
- uses: Swatinem/rust-cache@v2
43+
toolchain: 1.85
44+
targets: ${{ matrix.rust-target }}
4945

5046
- name: Build
51-
uses: actions-rs/cargo@v1
52-
with:
53-
command: build
54-
args: --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
47+
run: cargo build --release --target ${{ matrix.rust-target }} --manifest-path ./cli/Cargo.toml
5548

5649
- name: Prepare binary
5750
shell: bash

0 commit comments

Comments
 (0)