Skip to content

Commit 21fb9c1

Browse files
committed
ci: update building and testing configurations
1 parent 36eecf4 commit 21fb9c1

32 files changed

Lines changed: 336 additions & 774 deletions

.github/actions/build_and_test/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ runs:
3333
run: |
3434
if [ -n "${{ inputs.test_plan }}" ]; then
3535
xcodebuild clean test \
36+
CODE_SIGN_IDENTITY="" \
37+
CODE_SIGNING_REQUIRED=NO \
3638
-scheme ${{ inputs.scheme }} \
3739
-destination "${{ inputs.destination }}" \
3840
-testPlan ${{ inputs.test_plan }} \
3941
-enableCodeCoverage YES \
4042
-resultBundlePath "test_output/${{ inputs.name }}.xcresult" || exit 1
4143
else
4244
xcodebuild clean test \
45+
CODE_SIGN_IDENTITY="" \
46+
CODE_SIGNING_REQUIRED=NO \
4347
-scheme ${{ inputs.scheme }} \
4448
-destination "${{ inputs.destination }}" \
4549
-enableCodeCoverage YES \

.github/workflows/flare-ui.yml

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
name: flare-ui
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
paths:
10+
- ".github/**"
11+
- '.swiftlint.yml'
12+
- ".github/workflows/**"
13+
- "Package@swift-5.7.swift"
14+
- "Package@swift-5.8.swift"
15+
- "Package.swift"
16+
- "Source/FlareUI/**"
17+
- "Tests/FlareUITests/**"
18+
19+
permissions:
20+
contents: read
21+
22+
concurrency:
23+
group: flare-ui-${{ github.head_ref || github.ref }}
24+
cancel-in-progress: true
25+
26+
env:
27+
SCHEME_NAME: "FlareUI"
28+
29+
jobs:
30+
test-apple-platforms:
31+
name: ${{ matrix.name }}
32+
runs-on: ${{ matrix.runsOn }}
33+
env:
34+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
35+
timeout-minutes: 20
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
# macOS
41+
- { platform: macOS, name: "macOS 26, Xcode 26.0, Swift 6.2.0", xcode: "Xcode_26.0", runsOn: macOS-26, destination: "platform=macOS", testPlan: "FlareUIUnitTests", generateProject: false }
42+
- { platform: macOS, name: "macOS 14, Xcode 16.0, Swift 6.0.2", xcode: "Xcode_16.1", runsOn: macOS-14, destination: "platform=macOS", testPlan: "FlareUIUnitTests", generateProject: false }
43+
- { platform: macOS, name: "macOS 14, Xcode 15.4, Swift 5.10", xcode: "Xcode_15.4", runsOn: macOS-14, destination: "platform=macOS", testPlan: "FlareUIUnitTests", generateProject: false }
44+
- { platform: macOS, name: "macOS 14, Xcode 15.2, Swift 5.9.2", xcode: "Xcode_15.2", runsOn: macOS-14, destination: "platform=macOS", testPlan: "FlareUIUnitTests", generateProject: false }
45+
46+
# iOS
47+
- { platform: iOS, name: "iOS 26.0", xcode: "Xcode_26.0.1", runsOn: macOS-26, destination: "OS=26.0.1,name=iPhone 17 Pro", testPlan: "FlareUIUnitTests" }
48+
- { platform: iOS, name: "iOS 18.1", xcode: "Xcode_16.1", runsOn: macOS-14, destination: "OS=18.1,name=iPhone 16 Pro", testPlan: "FlareUIUnitTests" }
49+
- { platform: iOS, name: "iOS 17.2", xcode: "Xcode_15.2", runsOn: macOS-14, destination: "OS=17.2,name=iPhone 15 Pro", testPlan: "FlareUIUnitTests" }
50+
51+
# tvOS
52+
- { platform: tvOS, name: "tvOS 26.0", xcode: "Xcode_26.0.1", runsOn: macOS-26, destination: "OS=26.0,name=Apple TV", testPlan: "FlareUIUnitTests" }
53+
- { platform: tvOS, name: "tvOS 18.1", xcode: "Xcode_16.1", runsOn: macOS-14, destination: "OS=18.1,name=Apple TV", testPlan: "FlareUIUnitTests" }
54+
- { platform: tvOS, name: "tvOS 17.2", xcode: "Xcode_15.2", runsOn: macOS-14, destination: "OS=17.2,name=Apple TV", testPlan: "FlareUIUnitTests" }
55+
56+
# watchOS
57+
- { platform: watchOS, name: "watchOS 26.0", xcode: "Xcode_26.0.1", runsOn: macOS-26, destination: "OS=26.0,name=Apple Watch Ultra 3 (49mm)", testPlan: "FlareUIUnitTests" }
58+
- { platform: watchOS, name: "watchOS 11.1", xcode: "Xcode_16.1", runsOn: macOS-14, destination: "OS=11.1,name=Apple Watch Series 10 (46mm)", testPlan: "FlareUIUnitTests" }
59+
- { platform: watchOS, name: "watchOS 10.5", xcode: "Xcode_15.3", runsOn: macOS-14, destination: "OS=10.5,name=Apple Watch Series 9 (45mm)", testPlan: "FlareUIUnitTests" }
60+
- { platform: watchOS, name: "watchOS 10.2", xcode: "Xcode_15.2", runsOn: macOS-14, destination: "OS=10.2,name=Apple Watch Series 9 (45mm)", testPlan: "FlareUIUnitTests" }
61+
steps:
62+
- name: Checkout code
63+
uses: actions/checkout@v5
64+
- uses: jdx/mise-action@v3
65+
with:
66+
experimental: true
67+
- name: Run tests - ${{ matrix.name }}
68+
uses: ./.github/actions/build_and_test
69+
with:
70+
scheme: ${{ env.SCHEME_NAME }}
71+
destination: ${{ matrix.destination }}
72+
name: ${{ matrix.name }}
73+
test_plan: ${{ matrix.testPlan }}
74+
generate_project: ${{ matrix.generateProject || 'true' }}
75+
76+
- name: Upload test coverage to Codecov
77+
uses: ./.github/actions/upload_test_coverage_report
78+
with:
79+
scheme_name: ${{ env.SCHEME_NAME }}
80+
filename: ${{ matrix.name }}
81+
token: ${{ secrets.CODECOV_TOKEN }}
82+
83+
spm-build:
84+
name: ${{ matrix.name }}
85+
runs-on: ${{ matrix.runsOn }}
86+
env:
87+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
88+
timeout-minutes: 20
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
include:
93+
- { name: "macOS 26, SPM 6.2.0", xcode: "Xcode_26.0.1", runsOn: macOS-26 }
94+
- { name: "macOS 14, SPM 6.0.2", xcode: "Xcode_16.1", runsOn: macOS-14 }
95+
- { name: "macOS 14, SPM 5.10.0", xcode: "Xcode_15.3", runsOn: macOS-14 }
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v5
99+
100+
- name: Build with Swift Package Manager - ${{ matrix.name }}
101+
run: swift build -c release --target FlareUI
102+
103+
snapshots:
104+
name: snapshots / ${{ matrix.name }}
105+
runs-on: ${{ matrix.runsOn }}
106+
env:
107+
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer"
108+
timeout-minutes: 20
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
include:
113+
- { platform: iOS, name: "iOS 18.4", xcode: "Xcode_16.3", runsOn: macOS-15, destination: "OS=18.4,name=iPhone 16", testPlan: "SnapshotTests" }
114+
- { platform: tvOS, name: "tvOS 18.4", xcode: "Xcode_16.3", runsOn: macOS-15, destination: "OS=18.4,name=Apple TV", testPlan: "SnapshotTests" }
115+
steps:
116+
- name: Checkout code
117+
uses: actions/checkout@v5
118+
- uses: jdx/mise-action@v3
119+
with:
120+
experimental: true
121+
- name: Run snapshot tests - ${{ matrix.name }}
122+
uses: ./.github/actions/build_and_test
123+
with:
124+
scheme: ${{ env.SCHEME_NAME }}
125+
destination: ${{ matrix.destination }}
126+
name: ${{ matrix.name }}SnapshotTests
127+
test_plan: ${{ matrix.testPlan }}
128+
129+
- name: Upload test coverage to Codecov
130+
uses: ./.github/actions/upload_test_coverage_report
131+
with:
132+
scheme_name: ${{ env.SCHEME_NAME }}
133+
filename: ${{ matrix.name }}SnapshotTests
134+
token: ${{ secrets.CODECOV_TOKEN }}
135+
136+
merge-test-reports:
137+
needs: test-apple-platforms
138+
runs-on: macos-15
139+
steps:
140+
- name: Download artifacts
141+
uses: actions/download-artifact@v6
142+
with:
143+
path: test_output
144+
145+
- name: Merge test results
146+
run: xcrun xcresulttool merge test_output/**/*.xcresult --output-path test_output/final/final.xcresult
147+
148+
- name: Upload merged test results
149+
uses: actions/upload-artifact@v5
150+
with:
151+
name: MergedResult
152+
path: test_output/final
153+
retention-days: 30
154+
155+
discover-typos:
156+
name: Discover Typos
157+
runs-on: macos-15
158+
env:
159+
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
160+
steps:
161+
- name: Checkout code
162+
uses: actions/checkout@v5
163+
164+
- name: Set up Python environment
165+
run: |
166+
python3 -m venv .venv
167+
source .venv/bin/activate
168+
pip install --upgrade pip
169+
pip install codespell
170+
171+
- name: Discover typos
172+
run: |
173+
source .venv/bin/activate
174+
codespell --ignore-words-list="hart,inout,msdos,sur" --skip="./.build/*,./.git/*"

0 commit comments

Comments
 (0)