Repository navigation
89 lines (75 loc) · 2.2 KB
/
Copy pathiOS-tests.yml
File metadata and controls
89 lines (75 loc) · 2.2 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
84
85
86
87
88
89
name: LoopLine Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # enable manual trigger of the workflow
permissions:
contents: read
jobs:
unit-tests:
name: Unit Tests
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select Xcode
run: |
sudo xcode-select -s /Applications/Xcode.app
xcodebuild -version
- name: List available simulators
run: |
xcrun simctl list devices available
- name: Run unit tests
run: |
xcodebuild test \
-project LoopLine.xcodeproj \
-scheme LoopLine \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
-only-testing:LoopLineTests \
-derivedDataPath DerivedData \
-resultBundlePath TestResults/UnitTests.xcresult \
CODE_SIGNING_ALLOWED=NO
- name: Upload unit test results
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: TestResults/UnitTests.xcresult
if-no-files-found: error
ui-tests:
name: UI Tests
runs-on: macos-latest
timeout-minutes: 20
needs: unit-tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select Xcode
run: |
sudo xcode-select -s /Applications/Xcode.app
xcodebuild -version
- name: Boot simulator
run: |
xcrun simctl boot "iPhone 17" || true
- name: Run UI tests
run: |
xcodebuild test \
-project LoopLine.xcodeproj \
-scheme LoopLine \
-destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
-only-testing:LoopLineUITests \
-derivedDataPath DerivedData \
-resultBundlePath TestResults/UITests.xcresult \
CODE_SIGNING_ALLOWED=NO
- name: Upload UI test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ui-test-results
path: TestResults/UITests.xcresult
if-no-files-found: error