Skip to content

Commit 4344ba1

Browse files
authored
ci: add cache validation (#82)
* chore: explicitly disable the global cache * ci: add cache check * chore: update incorrect checksums
1 parent 1026fe1 commit 4344ba1

8 files changed

+36
-9
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,31 @@ on:
77
branches: [main]
88

99
jobs:
10+
chore:
11+
name: 'Testing chores'
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- run: |
18+
git fetch --no-tags --unshallow origin HEAD main
19+
20+
- uses: actions/setup-node@v2
21+
with:
22+
node-version: 14
23+
24+
- name: 'Check that the cache files are consistent with their remote sources'
25+
run: |
26+
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- .yarn/cache | wc -l) -gt 0 ]]; then
27+
yarn --immutable --immutable-cache --check-cache
28+
fi
29+
shell: bash
30+
if: |
31+
github.event.pull_request != ''
32+
env:
33+
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
34+
1035
build:
1136
strategy:
1237
fail-fast: false
@@ -20,6 +45,7 @@ jobs:
2045

2146
name: '${{matrix.platform}} w/ Node.js ${{matrix.node}}.x'
2247
runs-on: ${{matrix.platform}}
48+
needs: chore
2349

2450
steps:
2551
- uses: actions/checkout@v2

.pnp.cjs

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
enableGlobalCache: false
12
yarnPath: .yarn/releases/yarn-3.0.0.cjs

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ __metadata:
390390
"@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.0
391391
peerDependencies:
392392
"@babel/core": ^7.0.0-0
393-
checksum: 5a20d8bcbf2926dde3e9edcf847eaa5485d0d0fea76d0683ef1cafb11e0c35e46620391916283e1a9c0f76351e8c5ecccebf0d3a6bdf24559c5ad381433a0e3a
393+
checksum: 553988b4bc03ec51d97e16233a5d650b3e8ceb5e990bb7e412372c23fd3cd9192d145e5d8cd09d74e9302d0301e4992b9f427375601ca6607ff27d4836f9ffea
394394
languageName: node
395395
linkType: hard
396396

@@ -4896,7 +4896,7 @@ fsevents@^2.1.2:
48964896
"lodash.set@npm:^4.3.2":
48974897
version: 4.3.2
48984898
resolution: "lodash.set@npm:4.3.2"
4899-
checksum: 4dfedacae1c1cf86385a2b6e30ba538f06c90d703a0abd83a11432d80ec24b4016fe27359cdc0554a02a31a468789cbb282801dd755e54581cf0295477e2341d
4899+
checksum: a9122f49eef9f2d0fc9061a33d87f8e5b8c6b23d46e8b9e9ce1529d3588d79741bd1145a3abdfa3b13082703e65af27ff18d8a07bfc22b9be32f3fc36f763f70
49004900
languageName: node
49014901
linkType: hard
49024902

@@ -5246,7 +5246,7 @@ fsevents@^2.1.2:
52465246
json-stringify-safe: ^5.0.1
52475247
lodash.set: ^4.3.2
52485248
propagate: ^2.0.0
5249-
checksum: cc76d951783a0fe10c4a60800168f772d25fb0e1c87702f57db74d84a9bf0f5d4c25a5aa53717829e781f49f873ebdcb42d41efbcee097fff9f19633f321b485
5249+
checksum: 8217b7b45e48635b84a565866f4dd57eb4d3ea73e8a9091c8fa3a960ae819c3dc4298b6df979b17b014495c4f1bc5261ad71d02566a29f575e71f937c4c42922
52505250
languageName: node
52515251
linkType: hard
52525252

@@ -5796,7 +5796,7 @@ fsevents@^2.1.2:
57965796
"propagate@npm:^2.0.0":
57975797
version: 2.0.1
57985798
resolution: "propagate@npm:2.0.1"
5799-
checksum: dd67518106bb3f1ee230b7e246a18285467e010b89703844f120c38e1462b52d79bddd4be0f8db080377a3d55218209674eae9eb672c29a033bf6b44cfc42828
5799+
checksum: c4febaee2be0979e82fb6b3727878fd122a98d64a7fa3c9d09b0576751b88514a9e9275b1b92e76b364d488f508e223bd7e1dcdc616be4cdda876072fbc2a96c
58005800
languageName: node
58015801
linkType: hard
58025802

0 commit comments

Comments
 (0)