@@ -16,45 +16,6 @@ name: firestore
16
16
17
17
on :
18
18
pull_request :
19
- paths :
20
- # Firestore sources
21
- - ' Firestore/**'
22
-
23
- # Interop headers
24
- - ' FirebaseAuth/Interop/*.h'
25
-
26
- # FirebaseCore header change
27
- - ' FirebaseCore/Internal'
28
- - ' FirebaseCore/Sources/Public'
29
-
30
- # Podspec
31
- - ' FirebaseFirestore.podspec'
32
-
33
- # CMake
34
- - ' **CMakeLists.txt'
35
- - ' cmake/**'
36
-
37
- # Build scripts to which Firestore is sensitive
38
- #
39
- # Note that this doesn't include check scripts because changing those will
40
- # already trigger the check workflow.
41
- - ' scripts/binary_to_array.py'
42
- - ' scripts/build.sh'
43
- - ' scripts/install_prereqs.sh'
44
- - ' scripts/localize_podfile.swift'
45
- - ' scripts/pod_lib_lint.rb'
46
- - ' scripts/run_firestore_emulator.sh'
47
- - ' scripts/setup_*'
48
- - ' scripts/sync_project.rb'
49
- - ' scripts/test_quickstart.sh'
50
- - ' scripts/xcresult_logs.py'
51
-
52
- # This workflow
53
- - ' .github/workflows/firestore.yml'
54
-
55
- # Rebuild on Ruby infrastructure changes.
56
- - ' Gemfile*'
57
-
58
19
schedule :
59
20
# Run every day at 12am (PST) - cron uses UTC times
60
21
- cron : ' 0 8 * * *'
@@ -64,9 +25,60 @@ concurrency:
64
25
cancel-in-progress : true
65
26
66
27
jobs :
28
+ changes :
29
+ runs-on : macos-12
30
+ outputs :
31
+ changed : ${{ steps.changes.outputs.changed }}
32
+ steps :
33
+ - uses : dorny/paths-filter@v2
34
+ id : changes
35
+ with :
36
+ filters : |
37
+ changed:
38
+ # Firestore sources
39
+ - 'Firestore/**'
40
+
41
+ # Interop headers
42
+ - 'FirebaseAuth/Interop/*.h'
43
+
44
+ # FirebaseCore header change
45
+ - 'FirebaseCore/Internal'
46
+ - 'FirebaseCore/Sources/Public'
47
+
48
+ # Podspec
49
+ - 'FirebaseFirestore.podspec'
50
+
51
+ # CMake
52
+ - '**CMakeLists.txt'
53
+ - 'cmake/**'
54
+
55
+ # Build scripts to which Firestore is sensitive
56
+ #
57
+ # Note that this doesn't include check scripts because changing those will
58
+ # already trigger the check workflow.
59
+ - 'scripts/binary_to_array.py'
60
+ - 'scripts/build.sh'
61
+ - 'scripts/install_prereqs.sh'
62
+ - 'scripts/localize_podfile.swift'
63
+ - 'scripts/pod_lib_lint.rb'
64
+ - 'scripts/run_firestore_emulator.sh'
65
+ - 'scripts/setup_*'
66
+ - 'scripts/sync_project.rb'
67
+ - 'scripts/test_quickstart.sh'
68
+ - 'scripts/xcresult_logs.py'
69
+
70
+ # This workflow
71
+ - '.github/workflows/firestore.yml'
72
+
73
+ # Rebuild on Ruby infrastructure changes.
74
+ - 'Gemfile*'
75
+
67
76
check :
68
- # Don't run on private repo unless it is a PR.
69
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
77
+ needs : changes
78
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
79
+ if : |
80
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
81
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
70
82
runs-on : macos-12
71
83
steps :
72
84
- uses : actions/checkout@v3
@@ -83,10 +95,11 @@ jobs:
83
95
84
96
85
97
cmake :
86
- # Don't run on private repo unless it is a PR.
87
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
88
98
needs : check
89
-
99
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
100
+ if : |
101
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
102
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
90
103
strategy :
91
104
matrix :
92
105
os : [macos-12, ubuntu-latest]
@@ -124,8 +137,10 @@ jobs:
124
137
125
138
126
139
cmake-prod-db :
127
- # Don't run on private repo unless it is a PR.
128
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
140
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
141
+ if : |
142
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
143
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
129
144
needs : check
130
145
131
146
strategy :
@@ -172,8 +187,10 @@ jobs:
172
187
173
188
174
189
sanitizers :
175
- # Don't run on private repo unless it is a PR.
176
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
190
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
191
+ if : |
192
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
193
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
177
194
needs : check
178
195
179
196
strategy :
@@ -209,8 +226,10 @@ jobs:
209
226
210
227
211
228
xcodebuild :
212
- # Don't run on private repo unless it is a PR.
213
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
229
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
230
+ if : |
231
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
232
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
214
233
runs-on : macos-12
215
234
needs : check
216
235
@@ -234,8 +253,10 @@ jobs:
234
253
235
254
236
255
pod-lib-lint :
237
- # Don't run on private repo unless it is a PR.
238
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
256
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
257
+ if : |
258
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
259
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
239
260
runs-on : macos-12
240
261
needs : check
241
262
strategy :
@@ -297,8 +318,10 @@ jobs:
297
318
--no-analyze
298
319
299
320
spm :
300
- # Don't run on private repo unless it is a PR.
301
- if : (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
321
+ # Either a scheduled run from public repo, or a pull request with firestore changes.
322
+ if : |
323
+ (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') ||
324
+ (github.event_name == 'pull_request' && needs.changes.outputs.changed == 'true')
302
325
runs-on : macos-12
303
326
needs : check
304
327
steps :
@@ -332,6 +355,19 @@ jobs:
332
355
- name : Swift Build
333
356
run : scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift ${{ matrix.target }} spmbuildonly
334
357
358
+ # A job that fails if any required job in the test matrix fails,
359
+ # to be used as a required check for merging.
360
+ check-required-tests :
361
+ runs-on : ubuntu-latest
362
+ if : always()
363
+ name : Check all required Firestore tests results
364
+ needs : [cmake, cmake-prod-db, xcodebuild, spm]
365
+ steps :
366
+ - name : Check test matrix
367
+ if : needs.cmake.result == 'failure' || needs.cmake-prod-db.result == 'failure' || needs.xcodebuild.result == 'failure' || needs.spm.result == 'failure'
368
+ run : exit 1
369
+
370
+
335
371
# Disable until FirebaseUI is updated to accept Firebase 9 and quickstart is updated to accept
336
372
# Firebase UI 12
337
373
# quickstart:
0 commit comments