5
5
- main
6
6
- release/**
7
7
8
- paths :
9
- - " Sources/**"
10
- - " Samples/iOS-Swift/**"
11
- - " .github/workflows/testflight.yml"
12
- - " fastlane/**"
13
- - " scripts/ci-select-xcode.sh"
14
- - " scripts/ci-diagnostics.sh"
15
-
16
8
pull_request :
17
- paths :
18
- - " .github/workflows/testflight.yml"
19
- - " scripts/ci-diagnostics.sh"
20
9
workflow_dispatch :
21
10
22
11
# Concurrency configuration:
@@ -31,7 +20,23 @@ concurrency:
31
20
cancel-in-progress : ${{ github.event_name == 'pull_request' }}
32
21
33
22
jobs :
23
+ files-changed :
24
+ name : Detect File Changes
25
+ runs-on : ubuntu-latest
26
+ outputs :
27
+ run_testflight_for_changes : ${{ github.event_name == 'pull_request' && steps.changes.outputs.run_testflight_for_prs || steps.changes.outputs.run_testflight_for_pushes }}
28
+ steps :
29
+ - uses : actions/checkout@v5
30
+ - name : Get changed files
31
+ id : changes
32
+ uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
33
+ with :
34
+ token : ${{ github.token }}
35
+ filters : .github/file-filters.yml
36
+
34
37
upload_to_testflight :
38
+ if : needs.files-changed.outputs.run_testflight_for_changes == 'true'
39
+ needs : files-changed
35
40
name : Build and Upload iOS-Swift to Testflight
36
41
runs-on : macos-15
37
42
steps :
81
86
- name : Run CI Diagnostics
82
87
if : failure()
83
88
run : ./scripts/ci-diagnostics.sh
89
+
90
+ # This check validates that either upload_to_testflight passed or was skipped, which allows us
91
+ # to make testflight a required check with only running the upload_to_testflight when required.
92
+ # So, we don't have to run upload_to_testflight, for example, for unrelated changes.
93
+ testflight-required-check :
94
+ needs :
95
+ [
96
+ files-changed,
97
+ upload_to_testflight,
98
+ ]
99
+ name : Testflight
100
+ # This is necessary since a failed/skipped dependent job would cause this job to be skipped
101
+ if : always()
102
+ runs-on : ubuntu-latest
103
+ steps :
104
+ # If any jobs we depend on fails gets cancelled or times out, this job will fail.
105
+ # Skipped jobs are not considered failures.
106
+ - name : Check for failures
107
+ if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
108
+ run : |
109
+ echo "One of the testflight jobs has failed." && exit 1
0 commit comments