Skip to content

Commit 2a2e2b7

Browse files
authored
Move env set of Node Options from shell commands to Workflow configuation directives (#7785)
Migrate the configuration of NODE_OPTIONS from shell commands to GitHub Workflow env: directives.
1 parent ebc694a commit 2a2e2b7

11 files changed

+34
-40
lines changed

.github/workflows/e2e-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ on:
1919
repository_dispatch:
2020
types: [staging-tests,canary-tests]
2121

22+
env:
23+
# Bump Node memory limit
24+
NODE_OPTIONS: "--max_old_space_size=4096"
25+
2226
jobs:
2327
test:
2428
name: Run E2E Smoke Tests
2529
runs-on: ubuntu-latest
30+
2631
defaults:
2732
run:
2833
# Run any command steps in the /e2e subdir
@@ -39,8 +44,6 @@ jobs:
3944
run: |
4045
sudo apt-get update
4146
sudo apt-get install google-chrome-stable
42-
- name: Bump Node memory limit
43-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4447
- name: Write project config
4548
env:
4649
PROJECT_CONFIG: ${{ secrets.TEST_PROJECT_CONFIG }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ env:
2929
# - https://github.com/actions/checkout/issues/27
3030
# - https://github.com/actions/checkout/issues/237
3131
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
32+
# Bump Node memory limit
3233
NODE_OPTIONS: "--max-old-space-size=4096"
3334

3435
jobs:

.github/workflows/release-staging.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ on:
3535
type: boolean
3636
default: false
3737

38+
env:
39+
# Bump Node memory limit
40+
NODE_OPTIONS: "--max_old_space_size=4096"
41+
3842
jobs:
3943
deploy:
4044
name: Staging Release
@@ -46,8 +50,6 @@ jobs:
4650
uses: actions/setup-node@v3
4751
with:
4852
node-version: 16.x
49-
- name: Bump Node memory limit
50-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
5153
- name: Merge master into release
5254
uses: actions/github-script@v6
5355
with:

.github/workflows/test-all.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ env:
2626
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
2727
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
2828
artifactRetentionDays: 14
29+
# Bump Node memory limit
30+
NODE_OPTIONS: "--max_old_space_size=4096"
2931

3032
jobs:
3133
build:
3234
name: Build the SDK
3335
runs-on: ubuntu-latest
34-
env:
35-
NODE_OPTIONS: "--max_old_space_size=4096"
3636
steps:
3737
# Install Chrome so the correct version of webdriver can be installed by chromedriver when
3838
# setting up the repo. This must be done to build and execute Auth properly.
@@ -68,8 +68,6 @@ jobs:
6868
name: (bulk) Node.js and Browser (Chrome) Tests
6969
needs: build
7070
runs-on: ubuntu-latest
71-
env:
72-
NODE_OPTIONS: "--max_old_space_size=4096"
7371
steps:
7472
# install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
7573
- name: install Chrome stable
@@ -111,8 +109,6 @@ jobs:
111109
name: (Auth) Node.js and Browser (Chrome) Tests
112110
needs: build
113111
runs-on: ubuntu-latest
114-
env:
115-
NODE_OPTIONS: "--max_old_space_size=4096"
116112
steps:
117113
# install Chrome first, so the correct version of webdriver can be installed by chromedriver
118114
# when setting up the repo
@@ -157,8 +153,6 @@ jobs:
157153
if: false
158154
# Disable test for now since it's failing 100% of the time since
159155
# https://github.com/firebase/firebase-js-sdk/pull/7453 and it needs to be investigated.
160-
env:
161-
NODE_OPTIONS: "--max_old_space_size=4096"
162156
steps:
163157
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
164158
- name: install Chrome stable
@@ -203,8 +197,6 @@ jobs:
203197
name: Firestore Integration Tests (${{ matrix.persistence }})
204198
needs: build
205199
runs-on: ubuntu-latest
206-
env:
207-
NODE_OPTIONS: "--max_old_space_size=4096"
208200
steps:
209201
# install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
210202
- name: install Chrome stable

.github/workflows/test-changed-auth.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ env:
2323
# the beahvior to use the new URLs.
2424
CHROMEDRIVER_CDNURL: https://googlechromelabs.github.io/
2525
CHROMEDRIVER_CDNBINARIESURL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/
26+
# Bump Node memory limit
27+
NODE_OPTIONS: "--max_old_space_size=4096"
2628

2729
jobs:
2830
test-chrome:
@@ -44,8 +46,6 @@ jobs:
4446
uses: actions/setup-node@v3
4547
with:
4648
node-version: 16.x
47-
- name: Bump Node memory limit
48-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4949
- name: Test setup and yarn install
5050
run: |
5151
cp config/ci.config.json config/project.json
@@ -78,8 +78,6 @@ jobs:
7878
uses: actions/setup-node@v3
7979
with:
8080
node-version: 16.x
81-
- name: Bump Node memory limit
82-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
8381
- name: Test setup and yarn install
8482
run: |
8583
cp config/ci.config.json config/project.json

.github/workflows/test-changed-fcm-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on: pull_request
1919
env:
2020
# make chromedriver detect installed Chrome version and download the corresponding driver
2121
DETECT_CHROMEDRIVER_VERSION: true
22+
# Bump Node memory limit
23+
NODE_OPTIONS: "--max_old_space_size=4096"
2224

2325
jobs:
2426
test:
@@ -40,8 +42,6 @@ jobs:
4042
uses: actions/setup-node@v3
4143
with:
4244
node-version: 16.x
43-
- name: Bump Node memory limit
44-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4545
- name: Test setup and yarn install
4646
run: |
4747
cp config/ci.config.json config/project.json

.github/workflows/test-changed-firestore-integration.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ name: Test Firestore Integration
1616

1717
on: pull_request
1818

19+
env:
20+
# Bump Node memory limit
21+
NODE_OPTIONS: "--max_old_space_size=4096"
22+
1923
jobs:
2024
test:
2125
name: Test Firestore Integration If Changed
@@ -67,8 +71,6 @@ jobs:
6771
run: |
6872
sudo apt-get update
6973
sudo apt-get install google-chrome-stable
70-
- name: Bump Node memory limit
71-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
7274
- name: Test setup and yarn install
7375
run: yarn
7476
- name: build

.github/workflows/test-changed-firestore.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ on: pull_request
1818

1919
env:
2020
artifactRetentionDays: 14
21+
# Bump Node memory limit
22+
NODE_OPTIONS: "--max_old_space_size=4096"
2123

2224
jobs:
2325
build:
@@ -41,8 +43,6 @@ jobs:
4143
run: |
4244
sudo apt-get update
4345
sudo apt-get install google-chrome-stable
44-
- name: Bump Node memory limit
45-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4646
- name: Test setup and yarn install
4747
run: |
4848
cp config/ci.config.json config/project.json
@@ -96,8 +96,6 @@ jobs:
9696
name: build.tar.gz
9797
- name: Unzip build artifact
9898
run: tar xf build.tar.gz
99-
- name: Bump Node memory limit
100-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
10199
- name: Test setup and yarn install
102100
run: cp config/ci.config.json config/project.json
103101
- name: Run compat tests
@@ -126,8 +124,6 @@ jobs:
126124
name: build.tar.gz
127125
- name: Unzip build artifact
128126
run: tar xf build.tar.gz
129-
- name: Bump Node memory limit
130-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
131127
- name: Test setup and yarn install
132128
run: cp config/ci.config.json config/project.json
133129
- name: Run tests
@@ -158,8 +154,6 @@ jobs:
158154
name: build.tar.gz
159155
- name: Unzip build artifact
160156
run: tar xf build.tar.gz
161-
- name: Bump Node memory limit
162-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
163157
- name: Test setup and yarn install
164158
run: cp config/ci.config.json config/project.json
165159
- name: Run compat tests
@@ -193,8 +187,6 @@ jobs:
193187
uses: actions/setup-node@v3
194188
with:
195189
node-version: 16.x
196-
- name: Bump Node memory limit
197-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
198190
- name: Test setup and yarn install
199191
run: cp config/ci.config.json config/project.json
200192
- name: Run tests

.github/workflows/test-changed-misc.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ name: Test @firebase/rules-unit-testing
1616

1717
on: pull_request
1818

19+
env:
20+
# Bump Node memory limit
21+
NODE_OPTIONS: "--max_old_space_size=4096"
22+
1923
jobs:
2024
test:
2125
name: Test Misc Packages If Changed
@@ -35,8 +39,6 @@ jobs:
3539
run: |
3640
sudo apt-get update
3741
sudo apt-get install google-chrome-stable
38-
- name: Bump Node memory limit
39-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4042
- name: Test setup and yarn install
4143
run: |
4244
cp config/ci.config.json config/project.json

.github/workflows/test-changed.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ name: Test Modified Packages
1616

1717
on: pull_request
1818

19+
env:
20+
# Bump Node memory limit
21+
NODE_OPTIONS: "--max_old_space_size=4096"
22+
1923
jobs:
2024
test-chrome:
2125
name: Test Packages With Changed Files in Chrome and Node
@@ -35,8 +39,6 @@ jobs:
3539
run: |
3640
sudo apt-get update
3741
sudo apt-get install google-chrome-stable
38-
- name: Bump Node memory limit
39-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4042
- name: Test setup and yarn install
4143
run: |
4244
cp config/ci.config.json config/project.json
@@ -66,8 +68,6 @@ jobs:
6668
run: |
6769
sudo apt-get update
6870
sudo apt-get install firefox
69-
- name: Bump Node memory limit
70-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
7171
- name: Test setup and yarn install
7272
run: |
7373
cp config/ci.config.json config/project.json

.github/workflows/test-firebase-integration.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ name: Test Firebase Namespace
1616

1717
on: pull_request
1818

19+
env:
20+
# Bump Node memory limit
21+
NODE_OPTIONS: "--max_old_space_size=4096"
22+
1923
jobs:
2024
test:
2125
name: Test Firebase Namespace
@@ -35,8 +39,6 @@ jobs:
3539
run: |
3640
sudo apt-get update
3741
sudo apt-get install google-chrome-stable
38-
- name: Bump Node memory limit
39-
run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
4042
- name: Test setup and yarn install
4143
run: |
4244
cp config/ci.config.json config/project.json

0 commit comments

Comments
 (0)