Skip to content

Commit 87a8522

Browse files
committed
try everything
1 parent 040fb1f commit 87a8522

File tree

3 files changed

+56
-17
lines changed

3 files changed

+56
-17
lines changed

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414

1515
name: Test Package Paths
1616

17-
on: pull_request
17+
on:
18+
workflow_run:
19+
workflows: ["Build"]
20+
types:
21+
- completed
22+
pull_request:
1823

1924
jobs:
2025
test:
26+
if: ${{ github.event.workflow_run.conclusion }} == 'success'
2127
name: Test Package Paths
2228
runs-on: ubuntu-latest
2329

@@ -27,14 +33,22 @@ jobs:
2733
with:
2834
# This makes Actions fetch all Git history so run-changed script can diff properly.
2935
fetch-depth: 0
30-
- name: Set up Node (20)
31-
uses: actions/setup-node@v4
36+
- uses: actions/setup-node@v4
3237
with:
3338
node-version-file: '.nvmrc'
34-
- name: Yarn install
35-
run: yarn
36-
- name: Yarn build
37-
run: yarn build
39+
cache: yarn
40+
cache-dependency-path: yarn.lock
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+
- run: yarn install --frozen-lockfile
48+
- name: Download build archive
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: dists-${{ github.sha }}
3852
- name: Swap in public typings
3953
run: yarn release:prepare
4054
- name: Check paths

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
name: Health Metrics
1616

1717
on:
18+
workflow_run:
19+
workflows: ["Build"]
20+
types:
21+
- completed
1822
push:
1923
branches: ['**']
2024
pull_request:
@@ -35,24 +39,35 @@ env:
3539
jobs:
3640
binary-size:
3741
name: Binary Size
38-
if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]')
42+
if: (${{ github.event.workflow_run.conclusion }} == 'success' && (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]'))
3943
runs-on: ubuntu-latest
4044
steps:
4145
- uses: actions/checkout@v3
4246
- uses: actions/setup-node@v4
4347
with:
4448
node-version-file: '.nvmrc'
49+
cache: yarn
50+
cache-dependency-path: yarn.lock
51+
- name: Restore cached node_modules
52+
uses: actions/cache@v4
53+
id: node_modules
54+
with:
55+
path: "**/node_modules"
56+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
57+
- run: yarn install --frozen-lockfile
4558
- uses: 'google-github-actions/auth@v0'
4659
with:
4760
credentials_json: '${{ secrets.GCP_SA_KEY }}'
4861
- uses: google-github-actions/setup-gcloud@v2
49-
- run: yarn install
50-
- run: yarn build
62+
- name: Download build archive
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: dists-${{ github.sha }}
5166
- name: Run health-metrics/binary-size test
5267
run: yarn size-report
5368
modular-export-size:
5469
name: Binary Size For Modular Exports
55-
if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]')
70+
if: (${{ github.event.workflow_run.conclusion }} == 'success' && (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]'))
5671
runs-on: ubuntu-latest
5772
steps:
5873
- uses: actions/checkout@v3
@@ -63,8 +78,17 @@ jobs:
6378
with:
6479
credentials_json: '${{ secrets.GCP_SA_KEY }}'
6580
- uses: google-github-actions/setup-gcloud@v2
66-
- run: yarn install
67-
- run: yarn build
81+
- name: Restore cached node_modules
82+
uses: actions/cache@v4
83+
id: node_modules
84+
with:
85+
path: "**/node_modules"
86+
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
87+
- run: yarn install --frozen-lockfile
88+
- name: Download build archive
89+
uses: actions/download-artifact@v4
90+
with:
91+
name: dists-${{ github.sha }}
6892
- name: Run health-metrics/modular-exports-binary-size test
6993
run: yarn modular-export-size-report
7094
# TODO(yifany): Enable startup times testing on CI.

.github/workflows/test-all.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
workflows: ["Build"]
2020
types:
2121
- completed
22+
pull_request:
2223

2324
env:
2425
# make chromedriver detect installed Chrome version and download the corresponding driver
@@ -36,8 +37,8 @@ env:
3637
jobs:
3738
# Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.
3839
test-the-rest:
39-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
4040
name: (bulk) Node.js and Browser (Chrome) Tests
41+
if: ${{ github.event.workflow_run.conclusion }} == 'success'
4142
runs-on: ubuntu-latest
4243
steps:
4344
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
@@ -81,8 +82,8 @@ jobs:
8182
continue-on-error: true
8283

8384
test-auth:
84-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
8585
name: (Auth) Node.js and Browser (Chrome) Tests
86+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
8687
runs-on: ubuntu-latest
8788
steps:
8889
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
@@ -135,8 +136,8 @@ jobs:
135136
continue-on-error: true
136137

137138
test-firestore:
138-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
139139
name: (Firestore) Node.js and Browser (Chrome) Tests
140+
if: ${{ github.event.workflow_run.conclusion }} == 'success'
140141
runs-on: ubuntu-latest
141142
steps:
142143
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
@@ -179,7 +180,7 @@ jobs:
179180
path-to-lcov: ./lcov-all.info
180181
continue-on-error: true
181182
test-firestore-integration:
182-
if: ${{ github.event.workflow_run.conclusion == 'success'}}
183+
if: ${{ github.event.workflow_run.conclusion }} == 'success'
183184
strategy:
184185
fail-fast: false
185186
matrix:

0 commit comments

Comments
 (0)