-
-
Notifications
You must be signed in to change notification settings - Fork 29
142 lines (130 loc) · 4.16 KB
/
Copy pathtest.yml
File metadata and controls
142 lines (130 loc) · 4.16 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
name: Build
on:
pull_request:
branches:
- main
- dev
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
spm-tests:
name: SPM Package Tests
runs-on: macos-26
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Test MeshCore
run: |
run_tests() {
rm -f "$RUNNER_TEMP/watchdog-fired"
swift test --package-path MeshCore --no-parallel &
TEST_PID=$!
(
sleep 480
touch "$RUNNER_TEMP/watchdog-fired"
echo "::warning::swift test still running after 8 minutes - sampling process tree"
for pid in $(pgrep -f "MeshCorePackageTests|swiftpm-testing-helper|swift-test" || true); do
echo "=== sample of PID $pid ==="
sample "$pid" 5 2>/dev/null || true
done
kill -9 $TEST_PID 2>/dev/null || true
) &
WATCHDOG=$!
if wait $TEST_PID; then
kill $WATCHDOG 2>/dev/null || true
return 0
else
STATUS=$?
kill $WATCHDOG 2>/dev/null || true
return $STATUS
fi
}
STATUS=0
run_tests || STATUS=$?
if [ "$STATUS" -eq 0 ]; then
exit 0
fi
if [ -f "$RUNNER_TEMP/watchdog-fired" ]; then
echo "::warning::first attempt hung - retrying once"
run_tests
else
exit "$STATUS"
fi
- name: Test MC1Services
run: |
run_tests() {
rm -f "$RUNNER_TEMP/watchdog-fired"
swift test --package-path MC1Services --no-parallel &
TEST_PID=$!
(
sleep 480
touch "$RUNNER_TEMP/watchdog-fired"
echo "::warning::swift test still running after 8 minutes - sampling process tree"
for pid in $(pgrep -f "MC1ServicesPackageTests|swiftpm-testing-helper|swift-test" || true); do
echo "=== sample of PID $pid ==="
sample "$pid" 5 2>/dev/null || true
done
kill -9 $TEST_PID 2>/dev/null || true
) &
WATCHDOG=$!
if wait $TEST_PID; then
kill $WATCHDOG 2>/dev/null || true
return 0
else
STATUS=$?
kill $WATCHDOG 2>/dev/null || true
return $STATUS
fi
}
STATUS=0
run_tests || STATUS=$?
if [ "$STATUS" -eq 0 ]; then
exit 0
fi
if [ -f "$RUNNER_TEMP/watchdog-fired" ]; then
echo "::warning::first attempt hung - retrying once"
run_tests
else
exit "$STATUS"
fi
xcode-build:
name: Xcode Build
runs-on: macos-26
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install dependencies
run: |
brew install make
echo "$(brew --prefix make)/libexec/gnubin" >> "$GITHUB_PATH"
command -v xcodegen >/dev/null 2>&1 || brew install xcodegen
command -v swiftgen >/dev/null 2>&1 || brew install swiftgen
- name: Generate Xcode project
run: make generate
- name: Cache Xcode build
uses: irgaly/xcode-cache@v1
with:
key: xcode-deriveddata-${{ github.workflow }}-${{ github.sha }}
restore-keys: |
xcode-deriveddata-${{ github.workflow }}-
deriveddata-directory: .derivedData
delete-used-deriveddata-cache: true
- name: Build
run: |
xcodebuild build \
-project MC1.xcodeproj \
-scheme MC1 \
-destination "generic/platform=iOS Simulator" \
-derivedDataPath .derivedData \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
COMPILER_INDEX_STORE_ENABLE=NO