Skip to content

Commit 0019d7f

Browse files
committed
use yarn/node_modules cache everywhere, and upload test-changed builds
1 parent 42936e3 commit 0019d7f

20 files changed

+354
-268
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

.github/workflows/canary-deploy.yml

Lines changed: 10 additions & 4 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@v4
34+
- uses: actions/setup-node@v4
3635
with:
3736
node-version-file: '.nvmrc'
38-
- name: Yarn install
39-
run: yarn
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: 10 additions & 4 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@v4
37+
- uses: actions/setup-node@v4
3938
with:
4039
node-version-file: '.nvmrc'
41-
- name: Yarn install
42-
run: yarn
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: 10 additions & 4 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@v4
30+
- uses: actions/setup-node@v4
3231
with:
3332
node-version-file: '.nvmrc'
34-
- name: Yarn install
35-
run: yarn
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: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@
1515
name: Test Package Paths
1616

1717
on:
18-
workflow_run:
19-
workflows: ["Build"]
20-
types:
21-
- completed
2218
pull_request:
2319

2420
jobs:
2521
test:
26-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
2722
name: Test Package Paths
2823
runs-on: ubuntu-latest
2924

@@ -45,10 +40,7 @@ jobs:
4540
path: "**/node_modules"
4641
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
4742
- run: yarn install --frozen-lockfile
48-
- name: Download build archive
49-
uses: actions/download-artifact@v4
50-
with:
51-
name: dists-${{ github.sha }}
43+
- run: yarn build
5244
- name: Swap in public typings
5345
run: yarn release:prepare
5446
- name: Check paths

.github/workflows/deploy-config.yml

Lines changed: 10 additions & 4 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@v4
38+
- uses: actions/setup-node@v4
4039
with:
4140
node-version-file: '.nvmrc'
42-
- name: Yarn install
43-
run: yarn
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: 3 additions & 2 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:
4241
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: 10 additions & 4 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@v4
34+
- uses: actions/setup-node@v4
3635
with:
3736
node-version-file: '.nvmrc'
38-
- name: Yarn install
39-
run: yarn
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: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
name: Health Metrics
1616

1717
on:
18-
workflow_run:
19-
workflows: ["Build"]
20-
types:
21-
- completed
2218
push:
2319
branches: ['**']
2420
pull_request:
@@ -39,7 +35,7 @@ env:
3935
jobs:
4036
binary-size:
4137
name: Binary Size
42-
if: (${{ github.event.workflow_run.conclusion == 'success'}} && (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]'))
38+
if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]')
4339
runs-on: ubuntu-latest
4440
steps:
4541
- uses: actions/checkout@v3
@@ -59,15 +55,12 @@ jobs:
5955
with:
6056
credentials_json: '${{ secrets.GCP_SA_KEY }}'
6157
- uses: google-github-actions/setup-gcloud@v2
62-
- name: Download build archive
63-
uses: actions/download-artifact@v4
64-
with:
65-
name: dists-${{ github.sha }}
58+
- run: yarn build
6659
- name: Run health-metrics/binary-size test
6760
run: yarn size-report
6861
modular-export-size:
6962
name: Binary Size For Modular Exports
70-
if: (${{ github.event.workflow_run.conclusion == 'success'}} && (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]'))
63+
if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]')
7164
runs-on: ubuntu-latest
7265
steps:
7366
- uses: actions/checkout@v3
@@ -85,10 +78,7 @@ jobs:
8578
path: "**/node_modules"
8679
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
8780
- run: yarn install --frozen-lockfile
88-
- name: Download build archive
89-
uses: actions/download-artifact@v4
90-
with:
91-
name: dists-${{ github.sha }}
81+
- run: yarn build
9282
- name: Run health-metrics/modular-exports-binary-size test
9383
run: yarn modular-export-size-report
9484
# TODO(yifany): Enable startup times testing on CI.

.github/workflows/lint.yml

Lines changed: 10 additions & 4 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@v4
26+
- uses: actions/setup-node@v4
2827
with:
2928
node-version-file: '.nvmrc'
30-
- name: yarn install
31-
run: yarn
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

0 commit comments

Comments
 (0)