build(github CI): replace `actions/cache@v2` with `Swatinem/rust-cache@v2` (#123)

This commit is contained in:
HAOYUatHZ 2022-12-03 07:39:41 +08:00 committed by GitHub
parent e4071fea6e
commit e8642fe521
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 60 deletions

View File

@ -20,14 +20,7 @@ jobs:
- name: install target - name: install target
run: rustup target add aarch64-apple-darwin run: rustup target add aarch64-apple-darwin
- name: cargo cache artifacts - uses: Swatinem/rust-cache@v2
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- name: build - name: build
run: cargo build --package cli --release --target aarch64-apple-darwin run: cargo build --package cli --release --target aarch64-apple-darwin
@ -66,14 +59,7 @@ jobs:
- name: install target - name: install target
run: rustup target add x86_64-apple-darwin run: rustup target add x86_64-apple-darwin
- name: cargo cache artifacts - uses: Swatinem/rust-cache@v2
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- name: build - name: build
run: cargo build --package cli --release --target x86_64-apple-darwin run: cargo build --package cli --release --target x86_64-apple-darwin
@ -118,14 +104,7 @@ jobs:
sudo apt-get install -y gcc-aarch64-linux-gnu sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: cargo cache artifacts - uses: Swatinem/rust-cache@v2
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- name: build - name: build
run: cargo build --package cli --release --target aarch64-unknown-linux-gnu run: cargo build --package cli --release --target aarch64-unknown-linux-gnu
@ -164,14 +143,7 @@ jobs:
- name: install target - name: install target
run: rustup target add x86_64-unknown-linux-gnu run: rustup target add x86_64-unknown-linux-gnu
- name: cargo cache artifacts - uses: Swatinem/rust-cache@v2
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- name: build - name: build
run: cargo build --package cli --release --target x86_64-unknown-linux-gnu run: cargo build --package cli --release --target x86_64-unknown-linux-gnu

View File

@ -17,13 +17,7 @@ jobs:
profile: minimal profile: minimal
toolchain: nightly toolchain: nightly
override: true override: true
- uses: actions/cache@v2 - uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: check command: check
@ -38,13 +32,7 @@ jobs:
profile: minimal profile: minimal
toolchain: nightly toolchain: nightly
override: true override: true
- uses: actions/cache@v2 - uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: test command: test
@ -61,13 +49,7 @@ jobs:
toolchain: nightly toolchain: nightly
override: true override: true
components: rustfmt components: rustfmt
- uses: actions/cache@v2 - uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: fmt command: fmt
@ -84,13 +66,7 @@ jobs:
toolchain: nightly toolchain: nightly
override: true override: true
components: clippy components: clippy
- uses: actions/cache@v2 - uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/cargo@v1 - uses: actions-rs/cargo@v1
with: with:
command: clippy command: clippy