-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (72 loc) · 2.42 KB
/
xcode-recoreon-tests.yaml
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: "xcode-recoreon-tests"
"on":
push:
branches:
- "main"
pull_request:
branches:
- "main"
defaults:
run:
shell: "bash"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}"
env:
IOS_DEVICE: "iPhone 15"
IOS_RUNTIME: "17.4"
DEVELOPER_DIR: "/Applications/Xcode_15.3.app"
TEST_PLAN_NAME: "RecoreonTests"
# yamllint disable rule:line-length
jobs:
XcodeRecoreonTests:
runs-on: "macos-14"
timeout-minutes: 30
steps:
- name: "Start yeetd"
working-directory: "${{ runner.temp }}"
run: |
wget https://github.com/biscuitehh/yeetd/releases/download/1.0/yeetd-normal.pkg
sudo installer -pkg yeetd-normal.pkg -target /
yeetd &
- name: "Brew install"
run: "brew install gcovr xcodegen"
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Xcodegen"
run: "xcodegen generate"
- name: "Build tests"
run: |
xcodebuild \
-sdk iphonesimulator \
-project ./Recoreon.xcodeproj \
-scheme Recoreon \
-testPlan "$TEST_PLAN_NAME" \
-derivedDataPath ./DerivedData \
-testProductsPath "./$TEST_PLAN_NAME.xctestproducts" \
build-for-testing
- name: "Run tests"
run: |
xcodebuild \
-derivedDataPath ./DerivedData \
-destination "platform=iOS Simulator,name=$IOS_DEVICE,OS=$IOS_RUNTIME" \
-testProductsPath ./$TEST_PLAN_NAME.xctestproducts \
test-without-building
- name: "Export Swift coverage"
run: |
xcrun llvm-cov show \
--arch arm64 \
--instr-profile ./DerivedData/Build/ProfileData/*/Coverage.profdata \
--ignore-filename-regex=".*/Recoreon/(Preview Content|UI)/.*" \
./DerivedData/Build/Products/Debug-iphonesimulator/Recoreon.app/Recoreon \
>"$TEST_PLAN_NAME.coverage.txt"
- name: "Export Objective-C coverage"
run: "gcovr --cobertura $TEST_PLAN_NAME.coverage.xml --exclude RecoreonTests"
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v4"
with:
token: "${{ secrets.CODECOV_TOKEN }}"
disable_search: true
files: "${{ env.TEST_PLAN_NAME }}.coverage.txt,${{ env.TEST_PLAN_NAME }}.coverage.xml"
# yamllint enable