-
Notifications
You must be signed in to change notification settings - Fork 81
69 lines (60 loc) · 1.97 KB
/
Copy pathtests.yml
File metadata and controls
69 lines (60 loc) · 1.97 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
name: Tests
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Unit Tests
if: >-
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_16.3.app
- name: Resolve Swift packages
run: |
xcodebuild -resolvePackageDependencies \
-project Pika.xcodeproj \
-scheme Pika
# Build separately so script phase stderr (LaunchAtLogin keychain warning)
# doesn't prevent tests from running — Xcode 15+ fails the whole test action
# if any script phase emits to stderr, even with exit code 0.
- name: Build for testing
run: |
set -o pipefail
xcodebuild build-for-testing \
-project Pika.xcodeproj \
-scheme Pika \
-destination 'platform=macOS' \
-derivedDataPath build/DerivedData \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
2>&1 | xcpretty --color
- name: Run tests
run: |
set -o pipefail
XCTESTRUN=$(find build/DerivedData -name "*.xctestrun" | head -1)
echo "Using xctestrun: $XCTESTRUN"
if [ -z "$XCTESTRUN" ]; then
echo "Error: no .xctestrun file found"
find build/DerivedData -type f -name "*.xctestrun" || true
exit 1
fi
xcodebuild test-without-building \
-xctestrun "$XCTESTRUN" \
-destination 'platform=macOS'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v7
with:
name: test-results
path: build/DerivedData/**/Logs/Test/*.xcresult
retention-days: 7