ci: more effective cache config

This commit is contained in:
LongYinan 2022-04-15 21:22:04 +08:00
parent 5dd96c1b89
commit 9c55588889
9 changed files with 26 additions and 35 deletions

View file

@ -40,6 +40,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-linux-android-armv7-node@16-cargo-cache
- name: Cache NPM dependencies

View file

@ -40,6 +40,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-linux-android-node@16-cargo-cache
- name: Cache NPM dependencies

View file

@ -38,6 +38,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
target
key: bench-cargo-cache
- name: Cache NPM dependencies

View file

@ -36,6 +36,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-cargo-cache-build-binary
- name: 'Install dependencies'

View file

@ -33,26 +33,16 @@ jobs:
toolchain: stable
profile: minimal
override: true
- name: Install armv7 toolchain
run: rustup target add armv7-unknown-linux-gnueabihf
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
target: armv7-unknown-linux-gnueabihf
- name: Cache cargo
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: stable-linux-armv7-gnu-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-linux-armv7-gnu-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-linux-armv7-gnu-node@16-cargo-cache
- name: Cache NPM dependencies
uses: actions/cache@v2

View file

@ -43,6 +43,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-cache
- name: Cache NPM dependencies
@ -69,8 +70,3 @@ jobs:
yarn test --verbose
env:
RUST_BACKTRACE: 1
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache

View file

@ -50,6 +50,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-windows-arm64-node@16-cargo-cache
- name: Check build

View file

@ -49,14 +49,11 @@ jobs:
- name: Cache cargo
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: stable-windows-i686-node@lts-cargo-registry
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: stable-windows-i686-node@lts-cargo-index
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-windows-i686-node@16-cargo-cache
- name: Check build
uses: actions-rs/cargo@v1
@ -78,8 +75,3 @@ jobs:
yarn test --verbose
env:
RUST_BACKTRACE: 1
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache

View file

@ -40,6 +40,14 @@ jobs:
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: stable-zig-${{ matrix.target }}-cargo-cache
- name: Install aarch64 toolchain
run: rustup target add aarch64-unknown-linux-gnu
- name: Install ziglang
@ -50,7 +58,7 @@ jobs:
uses: actions/cache@v3
with:
path: .yarn/cache
key: npm-cache-linux-aarch64-gnu-node@16
key: npm-cache-ubuntu-latest-gnu-node@16
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'