1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore(ci): save cache on main at end of workflow (#17354)

Seems like our caching was totally broken. We need to save the cache
after building and not before.

```
Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
Warning: Cache save failed.
```
This commit is contained in:
David Sherret 2023-01-11 16:21:02 -05:00 committed by GitHub
parent b0e0e4f24b
commit b0eaa0ba70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 29 deletions

View file

@ -361,26 +361,9 @@ const ci = {
"18-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}", "18-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}",
}, },
}, },
{
// In main branch, always creates fresh cache
name: "Cache build output (main)",
uses: "actions/cache/save@v3",
if:
"(matrix.profile == 'release' || matrix.profile == 'fastci') && github.ref == 'refs/heads/main'",
with: {
path: [
"./target",
"!./target/*/gn_out",
"!./target/*/*.zip",
"!./target/*/*.tar.gz",
].join("\n"),
key:
"18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}",
},
},
{ {
// Restore cache from the latest 'main' branch build. // Restore cache from the latest 'main' branch build.
name: "Cache build output (PR)", name: "Restore cache build output (PR)",
uses: "actions/cache/restore@v3", uses: "actions/cache/restore@v3",
if: if:
"github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')", "github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')",
@ -790,6 +773,23 @@ const ci = {
draft: true, draft: true,
}, },
}, },
{
// In main branch, always creates fresh cache
name: "Save cache build output (main)",
uses: "actions/cache/save@v3",
if:
"(matrix.profile == 'release' || matrix.profile == 'fastci') && github.ref == 'refs/heads/main'",
with: {
path: [
"./target",
"!./target/*/gn_out",
"!./target/*/*.zip",
"!./target/*/*.tar.gz",
].join("\n"),
key:
"18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}",
},
},
]), ]),
], ],
}, },

View file

@ -240,17 +240,7 @@ jobs:
~/.cargo/git/db ~/.cargo/git/db
key: '18-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}' key: '18-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
if: steps.exit_early.outputs.EXIT_EARLY != 'true' if: steps.exit_early.outputs.EXIT_EARLY != 'true'
- name: Cache build output (main) - name: Restore cache build output (PR)
uses: actions/cache/save@v3
if: steps.exit_early.outputs.EXIT_EARLY != 'true' && ((matrix.profile == 'release' || matrix.profile == 'fastci') && github.ref == 'refs/heads/main')
with:
path: |-
./target
!./target/*/gn_out
!./target/*/*.zip
!./target/*/*.tar.gz
key: '18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}'
- name: Cache build output (PR)
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
if: 'steps.exit_early.outputs.EXIT_EARLY != ''true'' && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))' if: 'steps.exit_early.outputs.EXIT_EARLY != ''true'' && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))'
with: with:
@ -532,6 +522,16 @@ jobs:
target/release/lib.deno.d.ts target/release/lib.deno.d.ts
body_path: target/release/release-notes.md body_path: target/release/release-notes.md
draft: true draft: true
- name: Save cache build output (main)
uses: actions/cache/save@v3
if: steps.exit_early.outputs.EXIT_EARLY != 'true' && ((matrix.profile == 'release' || matrix.profile == 'fastci') && github.ref == 'refs/heads/main')
with:
path: |-
./target
!./target/*/gn_out
!./target/*/*.zip
!./target/*/*.tar.gz
key: '18-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }}'
publish-canary: publish-canary:
name: publish canary name: publish canary
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04