mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 11:53:59 -05:00
ci: restore cargo home cache before rust install (#27356)
I think this makes more sense. We'll see if it makes it faster. It was taking 1m 22s to install rust.
This commit is contained in:
parent
9d315f27ed
commit
39f7845d4e
2 changed files with 34 additions and 26 deletions
38
.github/workflows/ci.generate.ts
vendored
38
.github/workflows/ci.generate.ts
vendored
|
@ -484,6 +484,27 @@ const ci = {
|
||||||
" -czvf target/release/deno_src.tar.gz -C .. deno",
|
" -czvf target/release/deno_src.tar.gz -C .. deno",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Cache Cargo home",
|
||||||
|
uses: "actions/cache@v4",
|
||||||
|
with: {
|
||||||
|
// See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
|
||||||
|
// Note that with the new sparse registry format, we no longer have to cache a `.git` dir
|
||||||
|
path: [
|
||||||
|
"~/.cargo/.crates.toml",
|
||||||
|
"~/.cargo/.crates2.json",
|
||||||
|
"~/.cargo/bin",
|
||||||
|
"~/.cargo/registry/index",
|
||||||
|
"~/.cargo/registry/cache",
|
||||||
|
"~/.cargo/git/db",
|
||||||
|
].join("\n"),
|
||||||
|
key:
|
||||||
|
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ hashFiles('Cargo.lock') }}`,
|
||||||
|
// We will try to restore from the closest cargo-home we can find
|
||||||
|
"restore-keys":
|
||||||
|
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-`,
|
||||||
|
},
|
||||||
|
},
|
||||||
installRustStep,
|
installRustStep,
|
||||||
{
|
{
|
||||||
if:
|
if:
|
||||||
|
@ -607,23 +628,6 @@ const ci = {
|
||||||
installBenchTools,
|
installBenchTools,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Cache Cargo home",
|
|
||||||
uses: "actions/cache@v4",
|
|
||||||
with: {
|
|
||||||
// See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
|
|
||||||
// Note that with the new sparse registry format, we no longer have to cache a `.git` dir
|
|
||||||
path: [
|
|
||||||
"~/.cargo/registry/index",
|
|
||||||
"~/.cargo/registry/cache",
|
|
||||||
].join("\n"),
|
|
||||||
key:
|
|
||||||
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ hashFiles('Cargo.lock') }}`,
|
|
||||||
// We will try to restore from the closest cargo-home we can find
|
|
||||||
"restore-keys":
|
|
||||||
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-`,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
// Restore cache from the latest 'main' branch build.
|
// Restore cache from the latest 'main' branch build.
|
||||||
name: "Restore cache build output (PR)",
|
name: "Restore cache build output (PR)",
|
||||||
|
|
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
|
@ -174,6 +174,19 @@ jobs:
|
||||||
mkdir -p target/release
|
mkdir -p target/release
|
||||||
tar --exclude=".git*" --exclude=target --exclude=third_party/prebuilt \
|
tar --exclude=".git*" --exclude=target --exclude=third_party/prebuilt \
|
||||||
-czvf target/release/deno_src.tar.gz -C .. deno
|
-czvf target/release/deno_src.tar.gz -C .. deno
|
||||||
|
- name: Cache Cargo home
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |-
|
||||||
|
~/.cargo/.crates.toml
|
||||||
|
~/.cargo/.crates2.json
|
||||||
|
~/.cargo/bin
|
||||||
|
~/.cargo/registry/index
|
||||||
|
~/.cargo/registry/cache
|
||||||
|
~/.cargo/git/db
|
||||||
|
key: '30-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
|
||||||
|
restore-keys: '30-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
|
||||||
|
if: '!(matrix.skip)'
|
||||||
- uses: dsherret/rust-toolchain-file@v1
|
- uses: dsherret/rust-toolchain-file@v1
|
||||||
if: '!(matrix.skip)'
|
if: '!(matrix.skip)'
|
||||||
- if: '!(matrix.skip) && (matrix.job == ''lint'' || matrix.job == ''test'' || matrix.job == ''bench'')'
|
- if: '!(matrix.skip) && (matrix.job == ''lint'' || matrix.job == ''test'' || matrix.job == ''bench'')'
|
||||||
|
@ -355,15 +368,6 @@ jobs:
|
||||||
- name: Install benchmark tools
|
- name: Install benchmark tools
|
||||||
if: '!(matrix.skip) && (matrix.job == ''bench'')'
|
if: '!(matrix.skip) && (matrix.job == ''bench'')'
|
||||||
run: ./tools/install_prebuilt.js wrk hyperfine
|
run: ./tools/install_prebuilt.js wrk hyperfine
|
||||||
- name: Cache Cargo home
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |-
|
|
||||||
~/.cargo/registry/index
|
|
||||||
~/.cargo/registry/cache
|
|
||||||
key: '30-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
|
|
||||||
restore-keys: '30-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
|
|
||||||
if: '!(matrix.skip)'
|
|
||||||
- name: Restore cache build output (PR)
|
- name: Restore cache build output (PR)
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
if: '!(matrix.skip) && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))'
|
if: '!(matrix.skip) && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))'
|
||||||
|
|
Loading…
Add table
Reference in a new issue