-
-
Notifications
You must be signed in to change notification settings - Fork 6
83 lines (66 loc) · 2.28 KB
/
Copy pathtests.yml
File metadata and controls
83 lines (66 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
# Swift 6.2 Required
# Unit tests run automatically on push/PR
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
unit-tests:
name: Unit Tests
runs-on: macos-26
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Swift 6.2
uses: SwiftyLab/setup-swift@latest
with:
swift-version: "6.2.0"
- name: Get Swift version
run: swift --version
- name: Resolve dependencies
run: swift package resolve
- name: Run Tests with Coverage
run: swift test --parallel --enable-code-coverage
- name: Generate Coverage Report
run: |
# Find the test binary dynamically
TEST_BINARY=$(find .build -type f -path "*PackageTests.xctest/Contents/MacOS/*PackageTests" ! -path "*.dSYM/*" | head -n 1)
PROFDATA=$(find .build -name "default.profdata" -type f | head -n 1)
if [ -z "$TEST_BINARY" ] || [ -z "$PROFDATA" ]; then
echo "Error: Could not find test binary or profdata file"
echo "Searching for test binaries:"
find .build -type f -path "*PackageTests.xctest/Contents/MacOS/*PackageTests" ! -path "*.dSYM/*"
echo "Searching for profdata:"
find .build -name "*.profdata" -type f
exit 1
fi
echo "Using test binary: $TEST_BINARY"
echo "Using profdata: $PROFDATA"
# Generate coverage report for domain code only (Core + Configuration)
xcrun llvm-cov export -format="lcov" \
"$TEST_BINARY" \
-instr-profile "$PROFDATA" \
Sources/InAppKit/Core/ \
Sources/InAppKit/Configuration/ > coverage.lcov
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.lcov
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
build:
name: Build
runs-on: macos-26
needs: unit-tests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Swift 6.2
uses: SwiftyLab/setup-swift@latest
with:
swift-version: "6.2.0"
- name: Build
run: swift build -c release