ci: give each static Linux target its own cache and job
CI / Docker image (pull_request) Successful in 15s
CI / CLI (pull_request) Successful in 15s
CI / Server (pull_request) Successful in 25s
CI / CLI (linux-arm64, static) (pull_request) Successful in 1m44s
CI / CLI (windows) (pull_request) Successful in 2m8s
CI / CLI (linux-x86-64, static) (pull_request) Successful in 3m32s
CI / Docker image (pull_request) Successful in 15s
CI / CLI (pull_request) Successful in 15s
CI / Server (pull_request) Successful in 25s
CI / CLI (linux-arm64, static) (pull_request) Successful in 1m44s
CI / CLI (windows) (pull_request) Successful in 2m8s
CI / CLI (linux-x86-64, static) (pull_request) Successful in 3m32s
Both checks rebuilt from scratch every run: the arm64 key already existed, so the cache was never saved. Cache per target, build without debug info, check x86-64 in its own job, and stop caching cli/target on Windows.
This commit is contained in:
2 files changed
+39
-6
No files matched your search
+32
-6
@@ -69,10 +69,9 @@ jobs:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
cli/target
|
||||
key: ${{ runner.os }}-cargo-check-${{ hashFiles('cli/Cargo.lock') }}
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('cli/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-check-
|
||||
${{ runner.os }}-cargo-registry-
|
||||
|
||||
- name: Install Rust
|
||||
shell: powershell
|
||||
@@ -141,6 +140,8 @@ jobs:
|
||||
name: CLI (linux-arm64, static)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CARGO_PROFILE_DEV_DEBUG: "0"
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
@@ -150,18 +151,43 @@ jobs:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
cli/target
|
||||
cli/target/debug
|
||||
cli/target/aarch64-unknown-linux-musl
|
||||
key: ${{ runner.os }}-cargo-arm64-check-${{ hashFiles('cli/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-arm64-check-
|
||||
|
||||
- name: Add the static Linux targets
|
||||
run: rustup target add x86_64-unknown-linux-musl
|
||||
- name: Add the arm64 target
|
||||
run: rustup target add aarch64-unknown-linux-musl
|
||||
|
||||
- name: Cross-compile for arm64
|
||||
working-directory: cli
|
||||
run: cargo zigbuild --target aarch64-unknown-linux-musl --no-default-features
|
||||
|
||||
cli-x86-64:
|
||||
name: CLI (linux-x86-64, static)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CARGO_PROFILE_DEV_DEBUG: "0"
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
cli/target/debug
|
||||
cli/target/x86_64-unknown-linux-musl
|
||||
key: ${{ runner.os }}-cargo-x86-64-check-${{ hashFiles('cli/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-x86-64-check-
|
||||
|
||||
- name: Add the x86-64 target
|
||||
run: rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
- name: Cross-compile for x86-64
|
||||
working-directory: cli
|
||||
run: cargo zigbuild --target x86_64-unknown-linux-musl
|
||||
Reference in new issue
Block a user