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: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
target
key: stable-linux-android-armv7-node@16-cargo-cache key: stable-linux-android-armv7-node@16-cargo-cache
- name: Cache NPM dependencies - name: Cache NPM dependencies

View file

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

View file

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

View file

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

View file

@ -33,26 +33,16 @@ jobs:
toolchain: stable toolchain: stable
profile: minimal profile: minimal
override: true override: true
target: armv7-unknown-linux-gnueabihf
- 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
- name: Cache cargo - name: Cache cargo
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ~/.cargo/registry path: |
key: stable-linux-armv7-gnu-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} ~/.cargo/registry
~/.cargo/git
- name: Cache cargo index target
uses: actions/cache@v2 key: stable-linux-armv7-gnu-node@16-cargo-cache
with:
path: ~/.cargo/git
key: stable-linux-armv7-gnu-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache NPM dependencies - name: Cache NPM dependencies
uses: actions/cache@v2 uses: actions/cache@v2

View file

@ -43,6 +43,7 @@ jobs:
path: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
target
key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-cache key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-cache
- name: Cache NPM dependencies - name: Cache NPM dependencies
@ -69,8 +70,3 @@ jobs:
yarn test --verbose yarn test --verbose
env: env:
RUST_BACKTRACE: 1 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: | path: |
~/.cargo/registry ~/.cargo/registry
~/.cargo/git ~/.cargo/git
target
key: stable-windows-arm64-node@16-cargo-cache key: stable-windows-arm64-node@16-cargo-cache
- name: Check build - name: Check build

View file

@ -49,14 +49,11 @@ jobs:
- name: Cache cargo - name: Cache cargo
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.cargo/registry path: |
key: stable-windows-i686-node@lts-cargo-registry ~/.cargo/registry
~/.cargo/git
- name: Cache cargo index target
uses: actions/cache@v3 key: stable-windows-i686-node@16-cargo-cache
with:
path: ~/.cargo/git
key: stable-windows-i686-node@lts-cargo-index
- name: Check build - name: Check build
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
@ -78,8 +75,3 @@ jobs:
yarn test --verbose yarn test --verbose
env: env:
RUST_BACKTRACE: 1 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 profile: minimal
override: true override: true
target: ${{ matrix.target }} 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 - name: Install aarch64 toolchain
run: rustup target add aarch64-unknown-linux-gnu run: rustup target add aarch64-unknown-linux-gnu
- name: Install ziglang - name: Install ziglang
@ -50,7 +58,7 @@ jobs:
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: .yarn/cache path: .yarn/cache
key: npm-cache-linux-aarch64-gnu-node@16 key: npm-cache-ubuntu-latest-gnu-node@16
- name: Install dependencies - name: Install dependencies
run: yarn install --immutable --mode=skip-build run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript' - name: 'Build TypeScript'