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

+11-5
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

+11-5
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

+11-5
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

+12-7
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

+11-5
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

+4-3
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

+11-5
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

+20-6
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

+11-5
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

+11-5
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:

.github/workflows/release-log.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ jobs:
2828
- name: Checkout Repo
2929
uses: actions/checkout@v4
3030

31-
- name: Setup Node.js 20.x
32-
uses: actions/setup-node@master
31+
- uses: actions/setup-node@v4
3332
with:
34-
node-version: 22.10.0
33+
node-version-file: '.nvmrc'
3534

3635
- name: Get PR number and send to tracker.
3736
run: node scripts/ci/log-changesets.js

.github/workflows/release-pr.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@ jobs:
3232
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
3333
fetch-depth: 0
3434

35-
- name: Setup Node.js 20.x
36-
uses: actions/setup-node@master
35+
- uses: actions/setup-node@v4
3736
with:
38-
node-version: 22.10.0
37+
node-version-file: '.nvmrc'
38+
cache: yarn
39+
cache-dependency-path: yarn.lock
3940

40-
- name: Install Dependencies
41-
run: yarn
41+
- name: Restore cached node_modules
42+
uses: actions/cache@v4
43+
id: node_modules
44+
with:
45+
path: "**/node_modules"
46+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
47+
48+
- run: yarn install --frozen-lockfile
4249

4350
# Ensures a new @firebase/app is published with every release.
4451
# This keeps the SDK_VERSION variable up to date.

.github/workflows/release-prod.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ jobs:
3232
contents: write
3333

3434
steps:
35-
- name: Set up node (20)
36-
uses: actions/setup-node@v3
37-
with:
38-
node-version: 22.10.0
3935
- name: Checkout release branch (with history)
4036
uses: actions/checkout@v4
4137
with:
4238
# Release script requires git history and tags.
4339
fetch-depth: 0
4440
ref: ${{ github.event.inputs.release-branch }}
4541
token: ${{ secrets.OSS_BOT_GITHUB_TOKEN }}
46-
- name: Yarn install
47-
run: yarn
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version-file: '.nvmrc'
45+
cache: yarn
46+
cache-dependency-path: yarn.lock
47+
- run: yarn install --frozen-lockfile
4848
- name: Publish to NPM
4949
# --skipTests No need to run tests
5050
# --skipReinstall Yarn install has already been run

.github/workflows/release-staging.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ jobs:
4646
# Block this workflow if run on a non-release branch.
4747
if: github.event.inputs.release-branch == 'release' || endsWith(github.event.inputs.release-branch, '-releasebranch')
4848
steps:
49-
- name: Set up node (20)
50-
uses: actions/setup-node@v3
51-
with:
52-
node-version: 22.10.0
5349
- name: Merge main into release
5450
uses: actions/github-script@v6
5551
with:
@@ -68,8 +64,12 @@ jobs:
6864
# Release script requires git history and tags.
6965
fetch-depth: 0
7066
ref: ${{ github.event.inputs.release-branch }}
71-
- name: Yarn install
72-
run: yarn
67+
- uses: actions/setup-node@v4
68+
with:
69+
node-version-file: '.nvmrc'
70+
cache: yarn
71+
cache-dependency-path: yarn.lock
72+
- run: yarn install --frozen-lockfile
7373
- name: Publish to NPM
7474
# --skipTests No need to run tests
7575
# --skipReinstall Yarn install has already been run

.github/workflows/release-tweet.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ jobs:
3434
steps:
3535
- name: Checkout Repo
3636
uses: actions/checkout@v4
37-
- name: Setup Node.js 20.x
38-
uses: actions/setup-node@master
37+
- uses: actions/setup-node@v4
3938
with:
40-
node-version: 22.10.0
39+
node-version-file: '.nvmrc'
4140
- name: Poll release notes page on devsite
4241
run: node scripts/ci/poll_release_notes.js
4342
env:

0 commit comments

Comments
 (0)