7
7
env :
8
8
# make chromedriver detect installed Chrome version and download the corresponding driver
9
9
DETECT_CHROMEDRIVER_VERSION : true
10
+ artifactRetentionDays : 14
10
11
11
12
jobs :
12
- test :
13
- name : Node.js and Browser (Chrome) Tests
13
+ build :
14
+ name : Build the SDK
14
15
runs-on : ubuntu-latest
15
-
16
16
steps :
17
- # install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
17
+ # Install Chrome so the correct version of webdriver can be installed by chromedriver when
18
+ # setting up the repo. This must be done to build and execute Auth properly.
18
19
- name : install Chrome stable
19
20
# Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
20
21
# Temporary: Auth team will explore what's going wrong with the auth tests.
@@ -36,11 +37,99 @@ jobs:
36
37
yarn
37
38
- name : yarn build
38
39
run : yarn build
40
+ - name : Archive build
41
+ if : ${{ !cancelled() }}
42
+ run : |
43
+ tar -cf build.tar .
44
+ gzip build.tar
45
+ - name : Upload build archive
46
+ if : ${{ !cancelled() }}
47
+ uses : actions/upload-artifact@v3
48
+ with :
49
+ name : build.tar.gz
50
+ path : build.tar.gz
51
+ retention-days : ${{ env.artifactRetentionDays }}
52
+
53
+ # Auth and Firestore are built and executed in their own jobs in an attempt to reduce flakiness.
54
+ test-the-rest :
55
+ name : (bulk) Node.js and Browser (Chrome) Tests
56
+ needs : build
57
+ runs-on : ubuntu-latest
58
+ steps :
59
+ # install Chrome first, so the correct version of webdriver can be installed by chromedriver when setting up the repo
60
+ - name : install Chrome stable
61
+ run : |
62
+ sudo apt-get update
63
+ sudo apt-get install google-chrome-stable
64
+ - name : Download build archive
65
+ uses : actions/download-artifact@v3
66
+ with :
67
+ name : build.tar.gz
68
+ - name : Unzip build artifact
69
+ run : tar xf build.tar.gz
70
+ - name : Set up Node (16)
71
+ uses : actions/setup-node@v3
72
+ with :
73
+ node-version : 16.x
74
+ - name : Bump Node memory limit
75
+ run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
76
+ - name : Test setup and yarn install
77
+ run : |
78
+ cp config/ci.config.json config/project.json
79
+ yarn
80
+ - name : Set start timestamp env var
81
+ run : echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
82
+ - name : Run unit tests
83
+ # Ignore auth and firestore since they're handled in their own separate jobs.
84
+ run : |
85
+ xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' --concurrency 4 test:ci
86
+ node scripts/print_test_logs.js
87
+ env :
88
+ FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
89
+ - name : Generate coverage file
90
+ run : yarn ci:coverage
91
+ - name : Run coverage
92
+ uses : coverallsapp/github-action@master
93
+ with :
94
+ github-token : ${{ secrets.GITHUB_TOKEN }}
95
+ path-to-lcov : ./lcov-all.info
96
+ continue-on-error : true
97
+
98
+ test-auth :
99
+ name : (Auth) Node.js and Browser (Chrome) Tests
100
+ needs : build
101
+ runs-on : ubuntu-latest
102
+ steps :
103
+ # install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
104
+ - name : install Chrome stable
105
+ # Install Chrome version 110.0.5481.177-1 as some Auth tests start to fail on version 111.
106
+ # Temporary: Auth team will explore what's going wrong with the auth tests.
107
+ run : |
108
+ sudo apt-get update
109
+ sudo apt-get install wget
110
+ sudo wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_110.0.5481.177-1_amd64.deb
111
+ sudo apt-get install -f ./google-chrome-stable_110.0.5481.177-1_amd64.deb --allow-downgrades
112
+ - name : Download build archive
113
+ uses : actions/download-artifact@v3
114
+ with :
115
+ name : build.tar.gz
116
+ - name : Unzip build artifact
117
+ run : tar xf build.tar.gz
118
+ - name : Set up Node (16)
119
+ uses : actions/setup-node@v3
120
+ with :
121
+ node-version : 16.x
122
+ - name : Bump Node memory limit
123
+ run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
124
+ - name : Test setup and yarn install
125
+ run : |
126
+ cp config/ci.config.json config/project.json
127
+ yarn
39
128
- name : Set start timestamp env var
40
129
run : echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
41
130
- name : Run unit tests
42
131
run : |
43
- xvfb-run yarn test:ci
132
+ xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/auth*'
44
133
node scripts/print_test_logs.js
45
134
env :
46
135
FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
@@ -52,3 +141,81 @@ jobs:
52
141
github-token : ${{ secrets.GITHUB_TOKEN }}
53
142
path-to-lcov : ./lcov-all.info
54
143
continue-on-error : true
144
+
145
+ test-firestore :
146
+ name : (Firestore) Node.js and Browser (Chrome) Tests
147
+ needs : build
148
+ runs-on : ubuntu-latest
149
+ steps :
150
+ # install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
151
+ - name : install Chrome stable
152
+ run : |
153
+ sudo apt-get update
154
+ sudo apt-get install google-chrome-stable
155
+ - name : Download build archive
156
+ uses : actions/download-artifact@v3
157
+ with :
158
+ name : build.tar.gz
159
+ - name : Unzip build artifact
160
+ run : tar xf build.tar.gz
161
+ - name : Set up Node (16)
162
+ uses : actions/setup-node@v3
163
+ with :
164
+ node-version : 16.x
165
+ - name : Bump Node memory limit
166
+ run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
167
+ - name : Test setup and yarn install
168
+ run : |
169
+ cp config/ci.config.json config/project.json
170
+ yarn
171
+ - name : Set start timestamp env var
172
+ run : echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
173
+ - name : Run unit tests
174
+ run : |
175
+ xvfb-run yarn lerna run --concurrency 4 test:ci --scope '@firebase/firestore*'
176
+ node scripts/print_test_logs.js
177
+ env :
178
+ FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
179
+ - name : Generate coverage file
180
+ run : yarn ci:coverage
181
+ - name : Run coverage
182
+ uses : coverallsapp/github-action@master
183
+ with :
184
+ github-token : ${{ secrets.GITHUB_TOKEN }}
185
+ path-to-lcov : ./lcov-all.info
186
+ continue-on-error : true
187
+
188
+ test-firestore-integration :
189
+ name : Firestore Integration Tests
190
+ needs : build
191
+ runs-on : ubuntu-latest
192
+ steps :
193
+ # install Chrome so the correct version of webdriver can be installed by chromedriver when setting up the repo
194
+ - name : install Chrome stable
195
+ run : |
196
+ sudo apt-get update
197
+ sudo apt-get install google-chrome-stable
198
+ - name : Download build archive
199
+ uses : actions/download-artifact@v3
200
+ with :
201
+ name : build.tar.gz
202
+ - name : Unzip build artifact
203
+ run : tar xf build.tar.gz
204
+ - name : Set up Node (16)
205
+ uses : actions/setup-node@v3
206
+ with :
207
+ node-version : 16.x
208
+ - name : Bump Node memory limit
209
+ run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
210
+ - name : Test setup and yarn install
211
+ run : |
212
+ cp config/ci.config.json config/project.json
213
+ yarn
214
+ - name : Set start timestamp env var
215
+ run : echo "FIREBASE_CI_TEST_START_TIME=$(date +%s)" >> $GITHUB_ENV
216
+ - name : Run unit tests
217
+ run : |
218
+ xvfb-run yarn lerna run --concurrency 4 test:ci --scope firebase-firestore-integration-test
219
+ node scripts/print_test_logs.js
220
+ env :
221
+ FIREBASE_TOKEN : ${{ secrets.FIREBASE_CLI_TOKEN }}
0 commit comments