-
-
Notifications
You must be signed in to change notification settings - Fork 709
308 lines (261 loc) · 8.48 KB
/
macos-testing.yml
File metadata and controls
308 lines (261 loc) · 8.48 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
name: macOS Testing & Validation
# Story 1.10b - Automated macOS testing across Intel and Apple Silicon
# Story 6.1 - Added concurrency, normalized branches
on:
push:
branches: [main]
paths:
- 'installer/**'
- 'tests/macos/**'
- '.github/workflows/macos-testing.yml'
pull_request:
branches: [main]
paths:
- 'installer/**'
- 'tests/macos/**'
workflow_dispatch:
inputs:
test_suite:
description: 'Test suite to run'
required: false
default: 'all'
type: choice
options:
- all
- installation
- compatibility
- performance
- security
concurrency:
group: macos-testing-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Job 1: Intel Mac Testing
test-intel-mac:
name: Test on macOS Intel (x86_64)
runs-on: macos-13 # Intel runner
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Display system information
run: |
echo "=== System Information ==="
sw_vers
uname -a
echo "Architecture: $(uname -m)"
node --version
npm --version
echo "=========================="
- name: Install dependencies
run: npm ci
- name: Make test scripts executable
run: chmod +x tests/macos/*.sh
- name: Run Intel-specific tests
run: |
cd tests/macos
./test-intel-installation.sh || true
- name: Run compatibility tests
run: |
cd tests/macos
./test-shell-compatibility.sh
./test-path-handling.sh
./test-line-endings.sh
./test-permissions.sh
- name: Run integration tests
run: |
cd tests/macos
./test-homebrew-integration.sh
- name: Run performance benchmarks
run: |
cd tests/macos
./test-performance.sh
- name: Run security tests
run: |
cd tests/macos
./test-security.sh
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs-intel
path: /tmp/aios-test-*.log
retention-days: 30
# Job 2: Apple Silicon Testing
test-apple-silicon:
name: Test on macOS Apple Silicon (arm64)
runs-on: macos-14 # M1 runner
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Display system information
run: |
echo "=== System Information ==="
sw_vers
uname -a
echo "Architecture: $(uname -m)"
sysctl -n machdep.cpu.brand_string
node --version
npm --version
file $(which node)
echo "=========================="
- name: Install dependencies
run: npm ci
- name: Make test scripts executable
run: chmod +x tests/macos/*.sh
- name: Run Apple Silicon-specific tests
run: |
cd tests/macos
./test-apple-silicon-installation.sh || true
- name: Run compatibility tests
run: |
cd tests/macos
./test-shell-compatibility.sh
./test-path-handling.sh
./test-line-endings.sh
./test-permissions.sh
- name: Run integration tests
run: |
cd tests/macos
./test-homebrew-integration.sh
- name: Run performance benchmarks
run: |
cd tests/macos
./test-performance.sh
- name: Run security tests
run: |
cd tests/macos
./test-security.sh
- name: Verify native ARM execution
run: |
echo "Checking if Node.js runs natively on ARM..."
file $(which node) | grep arm64 || echo "WARNING: Node.js not running natively on ARM"
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs-apple-silicon
path: /tmp/aios-test-*.log
retention-days: 30
# Job 3: Error Recovery Testing
test-error-recovery:
name: Test Error Recovery & Rollback
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Make test scripts executable
run: chmod +x tests/macos/*.sh
- name: Run error recovery tests
run: |
cd tests/macos
./test-error-recovery.sh
- name: Upload test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: test-logs-error-recovery
path: /tmp/aios-test-*.log
retention-days: 30
# Job 4: Generate Test Report
generate-report:
name: Generate Test Report
runs-on: macos-latest
needs: [test-intel-mac, test-apple-silicon, test-error-recovery]
if: always()
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all test logs
uses: actions/download-artifact@v4
with:
path: test-results/
- name: Generate summary report
run: |
echo "# macOS Testing Summary" > test-summary.md
echo "" >> test-summary.md
echo "**Date:** $(date)" >> test-summary.md
echo "**Workflow:** ${{ github.workflow }}" >> test-summary.md
echo "**Commit:** ${{ github.sha }}" >> test-summary.md
echo "" >> test-summary.md
echo "## Test Results" >> test-summary.md
echo "" >> test-summary.md
echo "| Platform | Status |" >> test-summary.md
echo "|----------|--------|" >> test-summary.md
echo "| Intel Mac (x86_64) | ${{ needs.test-intel-mac.result }} |" >> test-summary.md
echo "| Apple Silicon (arm64) | ${{ needs.test-apple-silicon.result }} |" >> test-summary.md
echo "| Error Recovery | ${{ needs.test-error-recovery.result }} |" >> test-summary.md
echo "" >> test-summary.md
cat test-summary.md
- name: Upload test summary
uses: actions/upload-artifact@v4
with:
name: test-summary
path: test-summary.md
retention-days: 90
- name: Comment PR with results
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const summary = fs.readFileSync('test-summary.md', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: summary
});
# Job 5: Performance Comparison
performance-comparison:
name: Compare Intel vs Apple Silicon Performance
runs-on: macos-latest
needs: [test-intel-mac, test-apple-silicon]
if: always()
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download test logs
uses: actions/download-artifact@v4
with:
path: test-results/
- name: Analyze performance metrics
run: |
echo "# Performance Comparison Report" > perf-comparison.md
echo "" >> perf-comparison.md
echo "## Installation Performance" >> perf-comparison.md
echo "" >> perf-comparison.md
echo "| Metric | Intel | Apple Silicon |" >> perf-comparison.md
echo "|--------|-------|---------------|" >> perf-comparison.md
echo "| Installation Time | TBD | TBD |" >> perf-comparison.md
echo "| Health Check Time | TBD | TBD |" >> perf-comparison.md
echo "| CLI Response Time | TBD | TBD |" >> perf-comparison.md
echo "" >> perf-comparison.md
echo "*Note: Metrics extracted from test logs*" >> perf-comparison.md
- name: Upload performance report
uses: actions/upload-artifact@v4
with:
name: performance-comparison
path: perf-comparison.md
retention-days: 90