-
-
Notifications
You must be signed in to change notification settings - Fork 868
50 lines (43 loc) · 1.37 KB
/
run_unit_tests.yml
File metadata and controls
50 lines (43 loc) · 1.37 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
name: Run Unit Tests
on:
pull_request:
branches:
- 'main'
- 'liquid-glass'
- 'reading-challenge'
workflow_dispatch:
env:
XCODE_VERSION: "26.2"
IOS_VERSION: "26.2"
SCHEMES: "Wikipedia WMFComponents WMFData"
concurrency:
group: "unit-tests-${{ github.ref }}" # One group per branch
cancel-in-progress: true # Cancel older runs in the same group
jobs:
run-unit-tests:
runs-on: macos-latest
strategy:
matrix:
scheme: ["Wikipedia", "WMFComponents", "WMFData"]
name: Test ${{ matrix.scheme }}
steps:
- uses: actions/checkout@v4
- name: Select Xcode
run: |
sudo xcode-select -switch /Applications/Xcode_$XCODE_VERSION.app
- name: Test ${{ matrix.scheme }} scheme
run: |
xcrun simctl list
SIMULATORS=("iPhone 16")
for SIMULATOR in "${SIMULATORS[@]}"; do
echo "Running scheme: ${{ matrix.scheme }} on $SIMULATOR iOS $IOS_VERSION with Xcode $XCODE_VERSION"
xcodebuild test \
-scheme ${{ matrix.scheme }} \
-project Wikipedia.xcodeproj \
-destination "platform=iOS Simulator,name=$SIMULATOR,OS=$IOS_VERSION" \
| xcpretty
EXIT_CODE=${PIPESTATUS[0]}
if [ $EXIT_CODE -ne 0 ]; then
exit $EXIT_CODE
fi
done