Skip to content

Commit

Permalink
Move env set of Node Options from shell commands to Workflow configua…
Browse files Browse the repository at this point in the history
…tion directives (#7785)

Migrate the configuration of NODE_OPTIONS from shell commands  to GitHub Workflow env: directives.
  • Loading branch information
DellaBitta committed Nov 15, 2023
1 parent ebc694a commit 2a2e2b7
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 40 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ on:
repository_dispatch:
types: [staging-tests,canary-tests]

env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test:
name: Run E2E Smoke Tests
runs-on: ubuntu-latest

defaults:
run:
# Run any command steps in the /e2e subdir
Expand All @@ -39,8 +44,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Write project config
env:
PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/health-metrics-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ env:
# - https://github.com/actions/checkout/issues/27
# - https://github.com/actions/checkout/issues/237
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
# Bump Node memory limit
NODE_OPTIONS: "--max-old-space-size=4096"

jobs:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ on:
type: boolean
default: false

env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
deploy:
name: Staging Release
Expand All @@ -46,8 +50,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Merge master into release
uses: actions/github-script@v6
with:
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ env:
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
artifactRetentionDays: 14
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
build:
name: Build the SDK
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
# setting up the repo. This must be done to build and execute Auth properly.
Expand Down Expand Up @@ -68,8 +68,6 @@ jobs:
name: (bulk) Node.js and Browser (Chrome) Tests
needs: build
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
Expand Down Expand Up @@ -111,8 +109,6 @@ jobs:
name: (Auth) Node.js and Browser (Chrome) Tests
needs: build
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
# when setting up the repo
Expand Down Expand Up @@ -157,8 +153,6 @@ jobs:
if: false
# Disable test for now since it's failing 100% of the time since
# https://github.com/firebase/firebase-js-sdk/pull/7453 and it needs to be investigated.
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
Expand Down Expand Up @@ -203,8 +197,6 @@ jobs:
name: Firestore Integration Tests (${{ matrix.persistence }})
needs: build
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
- name: install Chrome stable
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test-changed-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ env:
# the beahvior to use the new URLs.
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test-chrome:
Expand All @@ -44,8 +46,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down Expand Up @@ -78,8 +78,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-changed-fcm-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on: pull_request
env:
# make chromedriver detect installed Chrome version and download the corresponding driver
DETECT_CHROMEDRIVER_VERSION: true
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test:
Expand All @@ -40,8 +42,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-changed-firestore-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ name: Test Firestore Integration

on: pull_request

env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test:
name: Test Firestore Integration If Changed
Expand Down Expand Up @@ -67,8 +71,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: yarn
- name: build
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/test-changed-firestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on: pull_request

env:
artifactRetentionDays: 14
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
build:
Expand All @@ -41,8 +43,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down Expand Up @@ -96,8 +96,6 @@ jobs:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run compat tests
Expand Down Expand Up @@ -126,8 +124,6 @@ jobs:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run tests
Expand Down Expand Up @@ -158,8 +154,6 @@ jobs:
name: build.tar.gz
- name: Unzip build artifact
run: tar xf build.tar.gz
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run compat tests
Expand Down Expand Up @@ -193,8 +187,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: cp config/ci.config.json config/project.json
- name: Run tests
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-changed-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ name: Test @firebase/rules-unit-testing

on: pull_request

env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test:
name: Test Misc Packages If Changed
Expand All @@ -35,8 +39,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ name: Test Modified Packages

on: pull_request

env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test-chrome:
name: Test Packages With Changed Files in Chrome and Node
Expand All @@ -35,8 +39,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down Expand Up @@ -66,8 +68,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install firefox
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-firebase-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ name: Test Firebase Namespace

on: pull_request

env:
# Bump Node memory limit
NODE_OPTIONS: "--max_old_space_size=4096"

jobs:
test:
name: Test Firebase Namespace
Expand All @@ -35,8 +39,6 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install google-chrome-stable
- name: Bump Node memory limit
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
- name: Test setup and yarn install
run: |
cp config/ci.config.json config/project.json
Expand Down

0 comments on commit 2a2e2b7

Please sign in to comment.