-
Notifications
You must be signed in to change notification settings - Fork 7.7k
119 lines (101 loc) · 3.32 KB
/
octreotide-ci.yml
File metadata and controls
119 lines (101 loc) · 3.32 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Octreotide CI
on:
push:
branches: [ feature/octreotide-algorithm ]
paths:
- 'Experimental/Octreotide/**'
pull_request:
branches: [ main ]
paths:
- 'Experimental/Octreotide/**'
workflow_dispatch: # Allow manual triggers
jobs:
test:
name: Run Tests
runs-on: macos-latest
strategy:
matrix:
xcode: ['14.3.1'] # Add more versions if needed
device: ['iPhone 14', 'iPhone 14 Pro', 'iPad Pro (12.9-inch) (6th generation)']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Run Unit Tests
run: |
xcodebuild test \
-workspace LoopWorkspace.xcworkspace \
-scheme LoopWorkspace \
-destination "platform=iOS Simulator,name=${{ matrix.device }},OS=latest" \
-only-testing:OctreotideAlgorithmTests \
-enableCodeCoverage YES \
-resultBundlePath TestResults.xcresult
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results-${{ matrix.device }}
path: TestResults.xcresult
- name: Generate Coverage Report
if: success()
run: |
xcrun xccov view --report TestResults.xcresult > coverage-${{ matrix.device }}.txt
- name: Upload Coverage
if: success()
uses: actions/upload-artifact@v3
with:
name: code-coverage-${{ matrix.device }}
path: coverage-${{ matrix.device }}.txt
integration-tests:
name: Integration Tests
needs: unit-tests
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode.app
- name: Run Simulation Tests
run: |
# Run simulator with different glucose patterns
xcodebuild test \
-workspace LoopWorkspace.xcworkspace \
-scheme LoopWorkspace \
-destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' \
-only-testing:GlucoseSimulatorTests \
-resultBundlePath SimResults.xcresult
- name: Upload Simulation Results
if: always()
uses: actions/upload-artifact@v3
with:
name: simulation-results
path: SimResults.xcresult
build-only:
name: Build Without Signing
needs: [unit-tests, integration-tests]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode.app
- name: Build for Simulator
run: |
xcodebuild build \
-workspace LoopWorkspace.xcworkspace \
-scheme LoopWorkspace \
-destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' \
-configuration Debug \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
- name: Archive Build Logs
if: always()
uses: actions/upload-artifact@v3
with:
name: build-logs
path: ~/Library/Developer/Xcode/DerivedData/**/Logs/Build