@@ -35,23 +35,27 @@ jobs:
35
35
yarn
36
36
- name : build
37
37
id : build
38
- # TODO(wuandy): Separate yarn and egrep into steps, so build failure
39
- # is captured by github actions.
40
- run : yarn build:changed firestore | egrep "Skipping all"
38
+ run : |
39
+ set -o pipefail
40
+ yarn build:changed firestore | tee ${{ runner.temp }}/yarn.log.txt
41
+ continue-on-error : false
42
+ - name : Check if Firestore is changed
43
+ id : check-changed
44
+ run : egrep "Skipping all" ${{ runner.temp }}/yarn.log.txt
41
45
# Continue when "Skipping all" is not found
42
46
continue-on-error : true
43
47
- name : set output
44
48
# This means "Skipping all" was not found
45
- if : steps.build .outcome != 'success'
49
+ if : steps.check-changed .outcome != 'success'
46
50
id : set-output
47
51
run : echo "CHANGED=true" >> "$GITHUB_OUTPUT";
48
52
- name : Archive build
49
- if : ${{ !cancelled() && steps.build.outcome != 'success' }}
53
+ if : ${{ !cancelled() && steps.build.outcome == 'success' && steps.check-changed.outcome != 'success' }}
50
54
run : |
51
- tar -cf build.tar --exclude="\ .git" .
55
+ tar -cf build.tar --exclude=.git .
52
56
gzip build.tar
53
57
- name : Upload build archive
54
- if : ${{ !cancelled() && steps.build.outcome != 'success' }}
58
+ if : ${{ !cancelled() && steps.build.outcome == 'success' && steps.check-changed.outcome != 'success' }}
55
59
uses : actions/upload-artifact@v3
56
60
with :
57
61
name : build.tar.gz
81
85
- name : Bump Node memory limit
82
86
run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
83
87
- name : Test setup and yarn install
84
- run : |
85
- cp config/ci.config.json config/project.json
88
+ run : cp config/ci.config.json config/project.json
86
89
- name : Run compat tests
87
90
run : cd packages/firestore-compat && yarn run test:ci
88
91
@@ -112,11 +115,41 @@ jobs:
112
115
- name : Bump Node memory limit
113
116
run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
114
117
- name : Test setup and yarn install
115
- run : |
116
- cp config/ci.config.json config/project.json
118
+ run : cp config/ci.config.json config/project.json
117
119
- name : Run tests
118
120
run : cd packages/firestore && yarn run ${{ matrix.test-name }}
119
121
122
+ compat-test-firefox :
123
+ name : Test Firestore Compatible on Firefox
124
+ # Whatever version of Firefox comes with 22.04 is causing Firefox
125
+ # startup to hang when launched by karma. Need to look further into
126
+ # why.
127
+ runs-on : ubuntu-20.04
128
+ needs : build
129
+ if : ${{ needs.build.outputs.changed == 'true'}}
130
+ steps :
131
+ - name : install Firefox stable
132
+ run : |
133
+ sudo apt-get update
134
+ sudo apt-get install firefox
135
+ - name : Set up Node (14)
136
+ uses : actions/setup-node@v3
137
+ with :
138
+ node-version : 14.x
139
+ - name : Download build archive
140
+ uses : actions/download-artifact@v3
141
+ with :
142
+ name : build.tar.gz
143
+ - name : Unzip build artifact
144
+ run : tar xf build.tar.gz
145
+ - name : Bump Node memory limit
146
+ run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
147
+ - name : Test setup and yarn install
148
+ run : cp config/ci.config.json config/project.json
149
+ - name : Run compat tests
150
+ run : cd packages/firestore-compat && xvfb-run yarn run test:ci
151
+ env :
152
+ BROWSERS : ' Firefox'
120
153
121
154
test-firefox :
122
155
name : Test Firestore on Firefox
@@ -147,9 +180,20 @@ jobs:
147
180
- name : Bump Node memory limit
148
181
run : echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV
149
182
- name : Test setup and yarn install
150
- run : |
151
- cp config/ci.config.json config/project.json
183
+ run : cp config/ci.config.json config/project.json
152
184
- name : Run tests
153
185
run : cd packages/firestore && xvfb-run yarn run ${{ matrix.test-name }}
154
186
env :
155
187
BROWSERS : ' Firefox'
188
+
189
+ # A job that fails if any required job in the test matrix fails,
190
+ # to be used as a required check for merging.
191
+ check-required-tests :
192
+ runs-on : ubuntu-latest
193
+ if : always()
194
+ name : Check all required tests results
195
+ needs : [build, test-chrome, compat-test-chrome]
196
+ steps :
197
+ - name : Check test matrix
198
+ if : needs.build.result == 'failure' || needs.test-chrome.result == 'failure' || needs.compat-test-chrome.result == 'failure'
199
+ run : exit 1
0 commit comments