Skip to content

Commit a50ccc7

Browse files
committed
Cache dependencies and archive builds in all workflows
1 parent e3e2078 commit a50ccc7

26 files changed

+550
-300
lines changed

.github/workflows/canary-deploy.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ jobs:
3131
with:
3232
# Canary release script requires git history and tags.
3333
fetch-depth: 0
34-
- name: Set up Node (20)
35-
uses: actions/setup-node@v3
34+
- uses: actions/setup-node@v4
3635
with:
37-
node-version: 22.10.0
38-
- name: Yarn install
39-
run: yarn
36+
node-version-file: '.nvmrc'
37+
cache: yarn
38+
cache-dependency-path: yarn.lock
39+
- name: Restore cached node_modules
40+
uses: actions/cache@v4
41+
id: node_modules
42+
with:
43+
path: "**/node_modules"
44+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
45+
- run: yarn install --frozen-lockfile
4046
- name: Deploy canary
4147
run: yarn release canary
4248
env:

.github/workflows/check-changeset.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ jobs:
3434
with:
3535
# This makes Actions fetch all Git history so check_changeset script can diff properly.
3636
fetch-depth: 0
37-
- name: Set up Node (20)
38-
uses: actions/setup-node@v3
37+
- uses: actions/setup-node@v4
3938
with:
40-
node-version: 22.10.0
41-
- name: Yarn install
42-
run: yarn
39+
node-version-file: '.nvmrc'
40+
cache: yarn
41+
cache-dependency-path: yarn.lock
42+
- name: Restore cached node_modules
43+
uses: actions/cache@v4
44+
id: node_modules
45+
with:
46+
path: "**/node_modules"
47+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
- run: yarn install --frozen-lockfile
4349
- name: Run changeset script
4450
# pull main so changeset can diff against it
4551
run: |

.github/workflows/check-docs.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,18 @@ jobs:
2727
with:
2828
# get all history for the diff
2929
fetch-depth: 0
30-
- name: Set up Node (20)
31-
uses: actions/setup-node@v3
30+
- uses: actions/setup-node@v4
3231
with:
33-
node-version: 22.10.0
34-
- name: Yarn install
35-
run: yarn
32+
node-version-file: '.nvmrc'
33+
cache: yarn
34+
cache-dependency-path: yarn.lock
35+
- name: Restore cached node_modules
36+
uses: actions/cache@v4
37+
id: node_modules
38+
with:
39+
path: "**/node_modules"
40+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
41+
- run: yarn install --frozen-lockfile
3642
- name: Run doc generation
3743
run: yarn docgen:all
3844
- name: Check for changes in docs-devsite dir (fail if so)

.github/workflows/check-pkg-paths.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ jobs:
2727
with:
2828
# This makes Actions fetch all Git history so run-changed script can diff properly.
2929
fetch-depth: 0
30-
- name: Set up Node (20)
31-
uses: actions/setup-node@v3
30+
- uses: actions/setup-node@v4
3231
with:
33-
node-version: 22.10.0
34-
- name: Yarn install
35-
run: yarn
36-
- name: Yarn build
37-
run: yarn build
32+
node-version-file: '.nvmrc'
33+
cache: yarn
34+
cache-dependency-path: yarn.lock
35+
- name: Restore cached node_modules
36+
uses: actions/cache@v4
37+
id: node_modules
38+
with:
39+
path: "**/node_modules"
40+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
41+
- run: yarn install --frozen-lockfile
42+
- run: yarn build
3843
- name: Swap in public typings
3944
run: yarn release:prepare
4045
- name: Check paths

.github/workflows/deploy-config.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,18 @@ jobs:
3535
with:
3636
# This makes Actions fetch all Git history so run-changed script can diff properly.
3737
fetch-depth: 0
38-
- name: Set up node (20)
39-
uses: actions/setup-node@v3
38+
- uses: actions/setup-node@v4
4039
with:
41-
node-version: 22.10.0
42-
- name: Yarn install
43-
run: yarn
40+
node-version-file: '.nvmrc'
41+
cache: yarn
42+
cache-dependency-path: yarn.lock
43+
- name: Restore cached node_modules
44+
uses: actions/cache@v4
45+
id: node_modules
46+
with:
47+
path: "**/node_modules"
48+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
49+
- run: yarn install --frozen-lockfile
4450
- name: Deploy project config if needed
4551
run: yarn ts-node scripts/ci-test/deploy-if-needed.ts
4652
env:

.github/workflows/e2e-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ jobs:
3636
steps:
3737
- name: Checkout Repo
3838
uses: actions/checkout@v4
39-
- name: Set up Node (20)
40-
uses: actions/setup-node@master
39+
- uses: actions/setup-node@v4
4140
with:
42-
node-version: 22.10.0
41+
node-version-file: '.nvmrc'
42+
cache: yarn
43+
cache-dependency-path: yarn.lock
4344
- name: install Chrome stable
4445
run: |
4546
sudo apt-get update

.github/workflows/format.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@ jobs:
3131
with:
3232
# get all history for the diff
3333
fetch-depth: 0
34-
- name: Set up node (20)
35-
uses: actions/setup-node@v3
34+
- uses: actions/setup-node@v4
3635
with:
37-
node-version: 22.10.0
38-
- name: Yarn install
39-
run: yarn
36+
node-version-file: '.nvmrc'
37+
cache: yarn
38+
cache-dependency-path: yarn.lock
39+
- name: Restore cached node_modules
40+
uses: actions/cache@v4
41+
id: node_modules
42+
with:
43+
path: "**/node_modules"
44+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
45+
- run: yarn install --frozen-lockfile
4046
- name: Run formatting script
4147
run: yarn format
4248
- name: Check for changes (fail if so)

.github/workflows/health-metrics-pull-request.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,22 @@ jobs:
3939
runs-on: ubuntu-latest
4040
steps:
4141
- uses: actions/checkout@v3
42-
- uses: actions/setup-node@v3
42+
- uses: actions/setup-node@v4
4343
with:
44-
node-version: 22.10.0
44+
node-version-file: '.nvmrc'
45+
cache: yarn
46+
cache-dependency-path: yarn.lock
47+
- name: Restore cached node_modules
48+
uses: actions/cache@v4
49+
id: node_modules
50+
with:
51+
path: "**/node_modules"
52+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
53+
- run: yarn install --frozen-lockfile
4554
- uses: 'google-github-actions/auth@v0'
4655
with:
4756
credentials_json: '${{ secrets.GCP_SA_KEY }}'
4857
- uses: google-github-actions/setup-gcloud@v2
49-
- run: yarn install
5058
- run: yarn build
5159
- name: Run health-metrics/binary-size test
5260
run: yarn size-report
@@ -56,14 +64,20 @@ jobs:
5664
runs-on: ubuntu-latest
5765
steps:
5866
- uses: actions/checkout@v3
59-
- uses: actions/setup-node@v3
67+
- uses: actions/setup-node@v4
6068
with:
61-
node-version: 22.10.0
69+
node-version-file: '.nvmrc'
6270
- uses: 'google-github-actions/auth@v0'
6371
with:
6472
credentials_json: '${{ secrets.GCP_SA_KEY }}'
6573
- uses: google-github-actions/setup-gcloud@v2
66-
- run: yarn install
74+
- name: Restore cached node_modules
75+
uses: actions/cache@v4
76+
id: node_modules
77+
with:
78+
path: "**/node_modules"
79+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
80+
- run: yarn install --frozen-lockfile
6781
- run: yarn build
6882
- name: Run health-metrics/modular-exports-binary-size test
6983
run: yarn modular-export-size-report

.github/workflows/lint.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@v3
26-
- name: Set up node (20)
27-
uses: actions/setup-node@v3
26+
- uses: actions/setup-node@v4
2827
with:
29-
node-version: 22.10.0
30-
- name: yarn install
31-
run: yarn
28+
node-version-file: '.nvmrc'
29+
cache: yarn
30+
cache-dependency-path: yarn.lock
31+
- name: Restore cached node_modules
32+
uses: actions/cache@v4
33+
id: node_modules
34+
with:
35+
path: "**/node_modules"
36+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
37+
- run: yarn install --frozen-lockfile
3238
- name: yarn lint
3339
run: yarn lint

.github/workflows/prerelease-manual-deploy.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ jobs:
3434
with:
3535
# Canary release script requires git history and tags.
3636
fetch-depth: 0
37-
- name: Set up node (20)
38-
uses: actions/setup-node@v3
37+
- uses: actions/setup-node@v4
3938
with:
40-
node-version: 22.10.0
41-
- name: Yarn install
42-
run: yarn
39+
node-version-file: '.nvmrc'
40+
cache: yarn
41+
cache-dependency-path: yarn.lock
42+
- name: Restore cached node_modules
43+
uses: actions/cache@v4
44+
id: node_modules
45+
with:
46+
path: "**/node_modules"
47+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
48+
- run: yarn install --frozen-lockfile
4349
- name: Deploy prerelease
4450
run: yarn release custom -p ${{ github.event.inputs.prereleaseName }} -t ${{ github.event.inputs.npmTag }}
4551
env:

0 commit comments

Comments
 (0)