This repository was archived by the owner on Oct 3, 2026. It is now read-only.
Repository navigation
122 lines (106 loc) · 3.45 KB
/
Copy pathci.yml
File metadata and controls
122 lines (106 loc) · 3.45 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
name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
# ⚠️ THE CONDITION IS THE LOAD-BEARING HALF. This workflow also fires on a push to `main` and
# `develop`, and THAT run is the one a merge is read against. An unconditional cancel throws it
# away when a second push lands behind it, leaving a check that reported NOTHING -- and a
# cancelled check reads as noise rather than as a failure.
#
# Outside a pull request the group then only SERIALIZES: two runs stay off one ref, for free.
# The cancel stays where it pays -- a pull request whose later push has overtaken the run in
# flight, which is where GitHub's per-job minute rounding actually bills for an answer about a
# tree that no longer exists.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: SwiftLint
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install SwiftLint
run: |
if ! command -v swiftlint >/dev/null 2>&1; then
brew install swiftlint
fi
- name: Run SwiftLint
run: swiftlint lint --config .swiftlint.yml --reporter github-actions-logging --strict --no-cache
format:
# Advisory until .swift-format rules are calibrated against the
# existing codebase. Kept visible in CI so drift is surfaced, but
# not a gate on merges yet.
name: swift-format (advisory)
runs-on: macos-15
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run swift-format lint
run: |
swift-format lint \
--configuration .swift-format \
--recursive \
--strict \
Spaceman SpacemanTests
build-test:
name: Build and Test
runs-on: macos-15
needs: [lint]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install xcbeautify
run: |
if ! command -v xcbeautify >/dev/null 2>&1; then
brew install xcbeautify
fi
- name: Show Xcode version
run: |
xcode-select -p
xcodebuild -version
- name: Resolve Swift packages
run: |
xcodebuild \
-project Spaceman.xcodeproj \
-scheme Spaceman \
-resolvePackageDependencies
- name: Build
run: |
set -o pipefail
xcodebuild \
-project Spaceman.xcodeproj \
-scheme Spaceman \
-configuration Debug \
-destination 'platform=macOS' \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
build \
| xcbeautify --renderer github-actions || exit $?
- name: Test
run: |
set -o pipefail
if xcodebuild \
-project Spaceman.xcodeproj \
-list 2>/dev/null | grep -q "SpacemanTests"; then
xcodebuild \
-project Spaceman.xcodeproj \
-scheme Spaceman \
-configuration Debug \
-destination 'platform=macOS' \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
test \
| xcbeautify --renderer github-actions || exit $?
else
echo "::notice::No SpacemanTests scheme yet — skipping test run."
fi