@@ -13,93 +13,46 @@ concurrency:
1313
1414jobs :
1515 unit-tests :
16- name : Unit Tests (${{ matrix.build.sdk }})
16+ name : Unit Tests (${{ matrix.build.name }})
1717 runs-on : ${{ matrix.build.runs-on }}
1818 timeout-minutes : 30
1919 strategy :
2020 matrix :
2121 build :
22- - sdk : " iphonesimulator "
23- destination : " platform=iOS Simulator,OS=18.1 ,name=iPhone 16 Pro"
24- action : " test"
22+ - name : iOS
23+ destination : " platform=iOS Simulator,OS=26.2 ,name=iPhone 17 Pro"
24+ action : " ci- test-ios "
2525 runs-on : " macos-15"
26- - sdk : " xros"
26+ - name : macOS
27+ destination : " platform=macOS,arch=arm64"
28+ action : " ci-test-macos"
29+ runs-on : " macos-15"
30+ - name : Mac Catalyst
31+ destination : " platform=macOS Catalyst,OS=16.0,name=Mac"
32+ action : " ci-test-maccatalyst"
33+ runs-on : " macos-15"
34+ - name : tvOS
35+ destination : " platform=tvOS Simulator,OS=17.2,name=Apple TV 4K (3rd generation)"
36+ action : " ci-test-tvos"
37+ runs-on : " macos-15"
38+ - name : watchOS
39+ destination : " platform=watchOS Simulator,OS=10.2,name=Apple Watch Series 8 - 45mm"
40+ action : " ci-test-watchos"
41+ runs-on : " macos-15"
42+ - name : visionOS
2743 destination : " platform=visionOS Simulator,OS=2.1,name=Apple Vision Pro"
28- action : " build "
44+ action : " ci-test-visionos "
2945 runs-on : " macos-15"
3046 steps :
3147 - name : Checkout the repository
3248 uses : actions/checkout@v5
33- - uses : maxim-lobanov/setup-xcode@v1
34- with :
35- xcode-version : latest-stable
36- - name : Check environment
37- run : |
38- set -ex
39- xcodebuild -version
40- swift --version
41- xcrun simctl list
42- - name : Enable development dependencies
43- run : |
44- sed -i.bak "s/\/\/dev//g" Package.swift
49+
4550 - name : Run Tests
46- run : |
47- set -o pipefail && \
48- env NSUnbufferedIO=YES \
49- xcodebuild -workspace . \
50- -scheme "TPPDF" \
51- -sdk "${{ matrix.build.sdk }}" \
52- -destination "${{ matrix.build.destination }}" \
53- -configuration Debug \
54- ${{ matrix.build.action == 'test' && '-enableCodeCoverage YES' || '' }} \
55- -derivedDataPath /tmp/DerivedData \
56- -resultBundlePath test_output \
57- CODE_SIGNING_ALLOWED="NO" \
58- ${{ matrix.build.action }} 2>&1 | tee test.log | xcbeautify
51+ run : make ${{ matrix.build.action }} DESTINATION="${{ matrix.build.destination }}"
52+
5953 - name : Upload test log file on error
6054 uses : actions/upload-artifact@v4
6155 if : failure()
6256 with :
6357 name : test.log
6458 path : test.log
65- - name : Generate code coverage reports
66- if : matrix.build.action == 'test'
67- run : |
68- PROFDATA_PATH=$(find /tmp/DerivedData -name "*.profdata")
69- echo "Detected profdata at path: $PROFDATA_PATH"
70- xcrun llvm-cov export \
71- /tmp/DerivedData/Build/Products/Debug-iphonesimulator/TPPDFTests.xctest/TPPDFTests \
72- --instr-profile $PROFDATA_PATH \
73- --format="lcov" > unit-tests.coverage.lcov
74- xcrun llvm-cov export \
75- /tmp/DerivedData/Build/Products/Debug-iphonesimulator/TPPDFIntegrationTests.xctest/TPPDFIntegrationTests \
76- --instr-profile $PROFDATA_PATH \
77- --format="lcov" > integration-tests.coverage.lcov
78-
79- macos-unit-tests :
80- name : Unit Tests (macos)
81- runs-on : macos-15
82- timeout-minutes : 30
83- steps :
84- - name : Checkout the repository
85- uses : actions/checkout@v5
86- - uses : maxim-lobanov/setup-xcode@v1
87- with :
88- xcode-version : latest-stable
89- - name : Check environment
90- run : |
91- set -ex
92- xcodebuild -version
93- swift --version
94- xcrun simctl list
95- - name : Enable development dependencies
96- run : |
97- sed -i.bak "s/\/\/dev//g" Package.swift
98- - name : Run tests
99- run : swift test --parallel --enable-code-coverage
100- - name : Generate code coverage reports
101- run : |
102- xcrun llvm-cov export \
103- .build/debug/TPPDFPackageTests.xctest/Contents/MacOS/TPPDFPackageTests \
104- --instr-profile .build/debug/codecov/default.profdata \
105- --format="lcov" > coverage.lcov
0 commit comments