11#
2- # This source file is part of the TemplatePackage open source project
2+ # This source file is part of the Stanford Biodesign Digital Health Group Swift Template Package open source project
33#
4- # SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
4+ # SPDX-FileCopyrightText: 2025 Stanford University and the project authors (see CONTRIBUTORS.md)
55#
66# SPDX-License-Identifier: MIT
77#
88
99name : Build and Test
1010
1111on :
12- workflow_call :
12+ push :
13+ branches :
14+ - main
15+ pull_request :
16+ workflow_dispatch :
17+
18+ concurrency :
19+ group : Build-and-Test-${{ github.ref }}
20+ cancel-in-progress : true
1321
1422jobs :
15- reuse_action :
16- name : REUSE Compliance Check
17- uses : StanfordBDHG/.github/.github/workflows/reuse.yml@v2
18- swiftlint :
19- name : SwiftLint
20- uses : StanfordBDHG/.github/.github/workflows/swiftlint.yml@v2
21- breaking_changes :
22- name : Diagnose Breaking Changes
23- uses : StanfordBDHG/.github/.github/workflows/breaking-changes.yml@v2
24- with :
25- runsonlabels : ' ["macOS", "self-hosted"]'
26- packageios :
27- name : Build and Test Swift Package iOS
28- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
29- with :
30- scheme : TemplatePackage
31- resultBundle : TemplatePackage-iOS.xcresult
32- artifactname : TemplatePackage-iOS.xcresult
33- packagewatchos :
34- name : Build and Test Swift Package watchOS
35- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
36- with :
37- scheme : TemplatePackage
38- destination : ' platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)'
39- resultBundle : TemplatePackage-watchOS.xcresult
40- artifactname : TemplatePackage-watchOS.xcresult
41- packagevisionos :
42- name : Build and Test Swift Package visionOS
23+ package_tests :
24+ name : Build and Test Swift Package ${{ matrix.platform.name }} (${{ matrix.config }})
4325 uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
26+ strategy :
27+ matrix :
28+ config : [Debug, Release]
29+ platform :
30+ - name : iOS
31+ destination : ' platform=iOS Simulator,name=iPhone 16 Pro'
32+ - name : macOS
33+ destination : ' platform=macOS,arch=arm64'
34+ - name : ' Mac Catalyst'
35+ destination : ' platform=macOS,arch=arm64,variant=Mac Catalyst'
36+ - name : watchOS
37+ destination : ' platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)'
38+ - name : visionOS
39+ destination : ' platform=visionOS Simulator,name=Apple Vision Pro'
40+ - name : tvOS
41+ destination : ' platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
42+ fail-fast : false
4443 with :
4544 runsonlabels : ' ["macOS", "self-hosted"]'
4645 scheme : TemplatePackage
47- destination : ' platform=visionOS Simulator,name=Apple Vision Pro'
48- resultBundle : TemplatePackage-visionOS.xcresult
49- artifactname : TemplatePackage-visionOS.xcresult
50- packagetvos :
51- name : Build and Test Swift Package tvOS
52- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
53- with :
54- scheme : TemplatePackage
55- resultBundle : TemplatePackage-tvOS.xcresult
56- destination : ' platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
57- artifactname : TemplatePackage-tvOS.xcresult
58- packagemacos :
59- name : Build and Test Swift Package macOS
60- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
61- with :
62- scheme : TemplatePackage
63- resultBundle : TemplatePackage-macOS.xcresult
64- destination : ' platform=macOS,arch=arm64'
65- artifactname : TemplatePackage-macOS.xcresult
66- ios :
67- name : Build and Test iOS
68- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
69- with :
70- path : ' Tests/UITests'
71- scheme : TestApp
72- resultBundle : TestApp-iOS.xcresult
73- artifactname : TestApp-iOS.xcresult
74- ipados :
75- name : Build and Test iPadOS
76- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
77- with :
78- path : ' Tests/UITests'
79- scheme : TestApp
80- destination : ' platform=iOS Simulator,name=iPad Air 13-inch (M2)'
81- resultBundle : TestApp-iPadOS.xcresult
82- artifactname : TestApp-iPadOS.xcresult
83- watchos :
84- name : Build and Test watchOS
46+ destination : ${{ matrix.platform.destination }}
47+ buildConfig : ${{ matrix.config }}
48+ resultBundle : ${{ format('TemplatePackage-{0}-{1}.xcresult', matrix.platform.name, matrix.config) }}
49+ artifactname : ${{ format('TemplatePackage-{0}-{1}.xcresult', matrix.platform.name, matrix.config) }}
50+ ui_tests :
51+ name : Build and Test UI Tests ${{ matrix.platform.name }} (${{ matrix.config }})
8552 uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
53+ strategy :
54+ matrix :
55+ config : [Debug, Release]
56+ platform :
57+ - name : iOS
58+ scheme : TestApp
59+ destination : ' platform=iOS Simulator,name=iPhone 16 Pro'
60+ - name : iPadOS
61+ scheme : TestApp
62+ destination : ' platform=iOS Simulator,name=iPad Air 13-inch (M3)'
63+ - name : watchOS
64+ scheme : TestAppWatchApp
65+ destination : ' platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)'
66+ - name : visionOS
67+ scheme : TestApp
68+ destination : ' platform=visionOS Simulator,name=Apple Vision Pro'
69+ - name : tvOS
70+ scheme : TestApp
71+ destination : ' platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
72+ fail-fast : false
8673 with :
8774 runsonlabels : ' ["macOS", "self-hosted"]'
8875 path : ' Tests/UITests'
89- scheme : TestAppWatchApp
90- destination : ' platform=watchOS Simulator,name=Apple Watch Series 10 (46mm)'
91- resultBundle : TestApp-watchOS.xcresult
92- artifactname : TestApp-watchOS.xcresult
93- visionos :
94- name : Build and Test visionOS
95- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
96- with :
97- runsonlabels : ' ["macOS", "self-hosted"]'
98- path : ' Tests/UITests'
99- scheme : TestApp
100- destination : ' platform=visionOS Simulator,name=Apple Vision Pro'
101- resultBundle : TestApp-visionOS.xcresult
102- artifactname : TestApp-visionOS.xcresult
103- tvos :
104- name : Build and Test tvOS
105- uses : StanfordBDHG/.github/.github/workflows/xcodebuild-or-fastlane.yml@v2
106- with :
107- path : ' Tests/UITests'
108- scheme : TestApp
109- destination : ' platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
110- resultBundle : TestApp-tvOS.xcresult
111- artifactname : TestApp-tvOS.xcresult
76+ scheme : ${{ matrix.platform.scheme }}
77+ destination : ${{ matrix.platform.destination }}
78+ resultBundle : ${{ format('TestApp-{0}-{1}.xcresult', matrix.platform.name, matrix.config) }}
79+ artifactname : ${{ format('TestApp-{0}-{1}.xcresult', matrix.platform.name, matrix.config) }}
11280 uploadcoveragereport :
11381 name : Upload Coverage Report
114- needs : [packageios, packagewatchos, packagevisionos, packagetvos, packagemacos, ios, ipados, watchos, visionos, tvos ]
82+ needs : [package_tests, ui_tests ]
11583 uses : StanfordBDHG/.github/.github/workflows/create-and-upload-coverage-report.yml@v2
11684 with :
117- coveragereports : TemplatePackage-iOS .xcresult TemplatePackage-watchOS.xcresult TemplatePackage-visionOS.xcresult TemplatePackage-tvOS.xcresult TemplatePackage-macOS.xcresult TestApp-iOS.xcresult TestApp-iPadOS.xcresult TestApp-watchOS.xcresult TestApp-visionOS.xcresult TestApp-tvOS .xcresult
85+ coveragereports : TemplatePackage-* .xcresult TestApp-* .xcresult
11886 secrets :
119- token : ${{ secrets.CODECOV_TOKEN }}
87+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments