33 push :
44 branches-ignore :
55 - ' *WIP'
6- env :
7- PACKAGE_NAME : RadiantKit
6+
87jobs :
98 build-ubuntu :
109 name : Build on Ubuntu
1312 if : " !contains(github.event.head_commit.message, 'ci skip')"
1413 runs-on : ubuntu-latest
1514 container :
16- image : swift:6.0.1-noble
15+ image : swift:6.0
1716 steps :
1817 - uses : actions/checkout@v4
1918 - name : Cache swift package modules
@@ -40,102 +39,108 @@ jobs:
4039 flags : swift-${{ matrix.swift-version }},ubuntu
4140 verbose : true
4241 token : ${{ secrets.CODECOV_TOKEN }}
43- files : ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
42+ files : ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
4443 build-macos :
4544 name : Build on macOS
46- runs-on : ${{ matrix.os }}
45+ env :
46+ PACKAGE_NAME : RadiantKit
47+ runs-on : ${{ matrix.runs-on }}
4748 if : " !contains(github.event.head_commit.message, 'ci skip')"
4849 strategy :
50+ fail-fast : false
4951 matrix :
5052 include :
51- - xcode : " /Applications/Xcode_16.1.app"
52- os : macos-14
53- iOSVersion : " 18.1"
54- watchOSVersion : " 11.0"
55- watchName : " Apple Watch Series 9 (41mm)"
56- iPhoneName : " iPhone 15"
53+ # SPM Build Matrix
54+ - runs-on : macos-15
55+ xcode : " /Applications/Xcode_16.1.app"
56+ - runs-on : macos-15
57+ xcode : " /Applications/Xcode_16.2.app"
58+
59+ # iOS Build Matrix
60+ - type : ios
61+ runs-on : macos-15
62+ xcode : " /Applications/Xcode_16.1.app"
63+ deviceName : " iPhone 16"
64+ osVersion : " 18.1"
65+ - type : ios
66+ runs-on : macos-15
67+ xcode : " /Applications/Xcode_16.2.app"
68+ deviceName : " iPhone 16 Pro"
69+ osVersion : " 18.2"
70+
71+ # watchOS Build Matrix
72+ - type : watchos
73+ runs-on : macos-15
74+ xcode : " /Applications/Xcode_16.1.app"
75+ deviceName : " Apple Watch Ultra 2 (49mm)"
76+ osVersion : " 11.1"
77+ - type : watchos
78+ runs-on : macos-15
79+ xcode : " /Applications/Xcode_16.2.app"
80+ deviceName : " Apple Watch Ultra 2 (49mm)"
81+ osVersion : " 11.2"
82+
83+ - type : visionos
84+ runs-on : macos-15
85+ xcode : " /Applications/Xcode_16.2.app"
86+ deviceName : " Apple Vision Pro"
87+ osVersion : " 2.1"
88+
5789 steps :
5890 - uses : actions/checkout@v4
91+
92+ - name : Set Xcode Name
93+ run : echo "XCODE_NAME=$(basename -- ${{ matrix.xcode }} | sed 's/\.[^.]*$//' | cut -d'_' -f2)" >> $GITHUB_ENV
94+
95+ - name : Setup Xcode
96+ run : sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
97+
98+ # SPM Cache Step
5999 - name : Cache swift package modules
60100 id : cache-spm-macos
61101 uses : actions/cache@v4
62102 env :
63103 cache-name : cache-spm
64104 with :
65105 path : .build
66- key : ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-${{ hashFiles('Package.resolved') }}
67- restore-keys : |
68- ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.xcode }}-
69- - name : Cache mint
70- if : startsWith(matrix.xcode,'/Applications/Xcode_16.1')
71- id : cache-mint
72- uses : actions/cache@v4
73- env :
74- cache-name : cache-mint
75- with :
76- path : .mint
77- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Mintfile') }}
106+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Package.resolved') }}
78107 restore-keys : |
79108 ${{ runner.os }}-build-${{ env.cache-name }}-
80109 ${{ runner.os }}-build-
81110 ${{ runner.os }}-
82- - name : Set Xcode Name
83- run : echo "XCODE_NAME=$(basename -- ${{ matrix.xcode }} | sed 's/\.[^.]*$//' | cut -d'_' -f2)" >> $GITHUB_ENV
84- - name : Setup Xcode
85- run : sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer || (sudo ls -1 /Applications | grep "Xcode")
111+
112+ - name : Build SPM
113+ if : " !matrix.type"
114+ run : swift build
115+
116+ - name : Run Swift Package tests
117+ if : " !matrix.type"
118+ run : swift test -v --enable-code-coverage
119+
86120 - name : Enable Swift Testing
87121 run : |
88122 mkdir -p ~/Library/org.swift.swiftpm/security/
89- cp macros.json ~/Library/org.swift.swiftpm/security/
90- - name : Install mint
91- if : startsWith(matrix.xcode,'/Applications/Xcode_16.1')
92- run : |
93- brew update
94- brew install mint
95- - name : Build
96- run : swift build
97- - name : Run Swift Package tests
98- run : swift test --enable-code-coverage
99- - uses : sersoft-gmbh/swift-coverage-action@v4
100- id : coverage-files-spm
101- with :
102- fail-on-empty-output : true
103- - name : Upload coverage reports to Codecov
104- uses : codecov/codecov- action@v4
123+ cp macros.json ~/Library/org.swift.swiftpm/security/
124+
125+ # Common iOS/watchOS Test Steps
126+ - name : Run Device Tests
127+ if : matrix.type
128+ run : >
129+ xcodebuild test
130+ -scheme ${{ env.PACKAGE_NAME }}-Package
131+ -sdk ${{ matrix.type == 'ios' && 'iphonesimulator' || matrix.type == 'watchos' && 'watchsimulator' || 'xrsimulator' }}
132+ -destination 'platform=${{ matrix.type == 'ios' && 'iOS Simulator' || matrix.type == 'watchos' && 'watchOS Simulator' || 'visionOS Simulator' }},name=${{ matrix.deviceName }},OS=${{ matrix.osVersion }}'
133+ -enableCodeCoverage YES
134+ build test
135+
136+ # Common Coverage Steps
137+ - name : Process Coverage
138+ uses : sersoft-gmbh/swift-coverage- action@v4
105139 with :
106- files : ${{ join(fromJSON(steps.coverage-files-spm.outputs.files), ',') }}
107- token : ${{ secrets.CODECOV_TOKEN }}
108- flags : macOS,${{ env.XCODE_NAME }},${{ matrix.runs-on }}
109- - name : Clean up spm build directory
110- run : rm -rf .build
111- - name : Lint
112- run : ./scripts/lint.sh
113- if : startsWith(matrix.xcode,'/Applications/Xcode_16.1')
114- - name : Run iOS target tests
115- run : xcodebuild test -scheme ${{ env.PACKAGE_NAME }}-Package -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
116- - uses : sersoft-gmbh/swift-coverage-action@v4
117- id : coverage-files-iOS
118- with :
119- fail-on-empty-output : true
120- - name : Upload coverage to Codecov
121- uses : codecov/codecov-action@v4
122- with :
123- fail_ci_if_error : true
124- verbose : true
125- token : ${{ secrets.CODECOV_TOKEN }}
126- files : ${{ join(fromJSON(steps.coverage-files-iOS.outputs.files), ',') }}
127- flags : iOS,iOS${{ matrix.iOSVersion }},macOS,${{ env.XCODE_NAME }}
128- - name : Run watchOS target tests
129- run : xcodebuild test -scheme ${{ env.PACKAGE_NAME }}-Package -destination 'platform=watchOS Simulator,name=${{ matrix.watchName }},OS=${{ matrix.watchOSVersion }}' -enableCodeCoverage YES build test
130- - uses : sersoft-gmbh/swift-coverage-action@v4
131- id : coverage-files-watchOS
132- with :
133140 fail-on-empty-output : true
134- - name : Upload coverage to Codecov
135- uses : codecov/codecov-action@v4
141+
142+ - name : Upload Coverage
143+ uses : codecov/codecov-action@v4
136144 with :
137- fail_ci_if_error : true
138- verbose : true
139- token : ${{ secrets.CODECOV_TOKEN }}
140- files : ${{ join(fromJSON(steps.coverage-files-watchOS.outputs.files), ',') }}
141- flags : watchOS,watchOS${{ matrix.watchOSVersion }},macOS,${{ env.XCODE_NAME }}
145+ token : ${{ secrets.CODECOV_TOKEN }}
146+ flags : ${{ matrix.type && format('{0}{1}', matrix.type, matrix.osVersion) || 'spm' }}
0 commit comments