Repository navigation
82 lines (68 loc) · 2.35 KB
/
Copy pathci.yml
File metadata and controls
82 lines (68 loc) · 2.35 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
format:
name: Format
runs-on: xcode-27
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Select latest stable Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: latest-stable
- name: Check formatting
run: xcrun swift-format lint --strict --recursive --parallel .
unit-tests:
name: Unit tests
runs-on: xcode-27
env:
SCHEME: Normal
SIMULATOR: iPhone 17
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Select latest stable Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: latest-stable
- name: Show toolchain
run: |
xcodebuild -version
xcrun simctl list runtimes | grep iOS || true
- name: Ensure xcbeautify
run: command -v xcbeautify >/dev/null || brew install xcbeautify
- name: Run unit tests
run: |
set -o pipefail
xcodebuild test \
-project Normal.xcodeproj \
-scheme "$SCHEME" \
-destination "platform=iOS Simulator,name=$SIMULATOR" \
-only-testing:NormalTests \
-resultBundlePath TestResults.xcresult \
-enableCodeCoverage YES \
CODE_SIGNING_ALLOWED=NO \
| xcbeautify --renderer github-actions --report junit
- name: Summarize results
if: ${{ !cancelled() }}
run: python3 .github/scripts/junit-summary.py build/reports/junit.xml >> "$GITHUB_STEP_SUMMARY"
- name: Coverage summary
if: ${{ !cancelled() }}
run: python3 .github/scripts/coverage-summary.py TestResults.xcresult "Unit test coverage" >> "$GITHUB_STEP_SUMMARY"
- name: Upload result bundle
if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: unit-test-results
path: |
TestResults.xcresult
build/reports/junit.xml
if-no-files-found: ignore