Share one tool cache between CI and release builds, fall back to the last tools after a mise.toml change, and cache cargo-xwin for the Windows build
ci / check (push) Successful in 2m56s
ci / check (push) Successful in 2m56s
This commit is contained in:
@@ -14,6 +14,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
# The same tool cache as in release.yaml: the same key and the same folders, or
|
||||||
|
# neither job can use what the other saved.
|
||||||
- name: Restore tool cache
|
- name: Restore tool cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -24,7 +26,10 @@ jobs:
|
|||||||
~/.rustup
|
~/.rustup
|
||||||
~/.local/bin/mise
|
~/.local/bin/mise
|
||||||
~/.local/share/mise
|
~/.local/share/mise
|
||||||
key: tools-check-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
|
key: tools-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
|
||||||
|
# After a change to mise.toml, start from the last tools; mise installs only what changed.
|
||||||
|
restore-keys: |
|
||||||
|
tools-
|
||||||
- name: Restore build cache
|
- name: Restore build cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ jobs:
|
|||||||
CARGO_BUILD_JOBS: "2"
|
CARGO_BUILD_JOBS: "2"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
# The same tool cache as in ci.yaml: the same key and the same folders, or
|
||||||
|
# neither job can use what the other saved.
|
||||||
- name: Restore tool cache
|
- name: Restore tool cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
# ~/.cache/cargo-xwin holds the Windows SDK files cargo-xwin downloads.
|
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/bin
|
~/.cargo/bin
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
@@ -35,8 +36,22 @@ jobs:
|
|||||||
~/.rustup
|
~/.rustup
|
||||||
~/.local/bin/mise
|
~/.local/bin/mise
|
||||||
~/.local/share/mise
|
~/.local/share/mise
|
||||||
|
key: tools-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
|
||||||
|
# After a change to mise.toml, start from the last tools; mise installs only what changed.
|
||||||
|
restore-keys: |
|
||||||
|
tools-
|
||||||
|
# cargo-xwin, which takes minutes to compile, and the Windows SDK files it downloads.
|
||||||
|
# The Windows Rust target is left out: rustup lists its installed parts in a file in
|
||||||
|
# the tool cache, and refuses to install the target over files that list does not name.
|
||||||
|
- name: Restore cargo-xwin cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/cargo-xwin
|
||||||
~/.cache/cargo-xwin
|
~/.cache/cargo-xwin
|
||||||
key: tools-release-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
|
key: cargo-xwin-${{ hashFiles('scripts/ci-setup.sh', 'mise.toml') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-xwin-
|
||||||
- name: Restore build cache
|
- name: Restore build cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user