Skip to content

Commit

Permalink
try everything
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Nov 4, 2024
1 parent 040fb1f commit 87a8522
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 17 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/check-pkg-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@

name: Test Package Paths

on: pull_request
on:
workflow_run:
workflows: ["Build"]
types:
- completed
pull_request:

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

Expand All @@ -27,14 +33,22 @@ jobs:
with:
# This makes Actions fetch all Git history so run-changed script can diff properly.
fetch-depth: 0
- name: Set up Node (20)
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Yarn install
run: yarn
- name: Yarn build
run: yarn build
cache: yarn
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- name: Download build archive
uses: actions/download-artifact@v4
with:
name: dists-${{ github.sha }}
- name: Swap in public typings
run: yarn release:prepare
- name: Check paths
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/health-metrics-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
name: Health Metrics

on:
workflow_run:
workflows: ["Build"]
types:
- completed
push:
branches: ['**']
pull_request:
Expand All @@ -35,24 +39,35 @@ env:
jobs:
binary-size:
name: Binary Size
if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]')
if: (${{ github.event.workflow_run.conclusion }} == 'success' && (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- uses: google-github-actions/setup-gcloud@v2
- run: yarn install
- run: yarn build
- name: Download build archive
uses: actions/download-artifact@v4
with:
name: dists-${{ github.sha }}
- name: Run health-metrics/binary-size test
run: yarn size-report
modular-export-size:
name: Binary Size For Modular Exports
if: (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]')
if: (${{ github.event.workflow_run.conclusion }} == 'success' && (github.event_name == 'push' || !(github.event.pull_request.head.repo.fork)) && (github.actor != 'dependabot[bot]'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -63,8 +78,17 @@ jobs:
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- uses: google-github-actions/setup-gcloud@v2
- run: yarn install
- run: yarn build
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
- name: Download build archive
uses: actions/download-artifact@v4
with:
name: dists-${{ github.sha }}
- name: Run health-metrics/modular-exports-binary-size test
run: yarn modular-export-size-report
# TODO(yifany): Enable startup times testing on CI.
9 changes: 5 additions & 4 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
workflows: ["Build"]
types:
- completed
pull_request:

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

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

test-firestore:
if: ${{ github.event.workflow_run.conclusion == 'success'}}
name: (Firestore) Node.js and Browser (Chrome) Tests
if: ${{ github.event.workflow_run.conclusion }} == 'success'
runs-on: ubuntu-latest
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
Expand Down Expand Up @@ -179,7 +180,7 @@ jobs:
path-to-lcov: ./lcov-all.info
continue-on-error: true
test-firestore-integration:
if: ${{ github.event.workflow_run.conclusion == 'success'}}
if: ${{ github.event.workflow_run.conclusion }} == 'success'
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit 87a8522

Please sign in to comment.