-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (130 loc) · 4.23 KB
/
ci.yml
File metadata and controls
163 lines (130 loc) · 4.23 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MISE_GITHUB_GITHUB_ATTESTATIONS: false
jobs:
lint:
name: Lint
runs-on: macos-15
steps:
- uses: actions/checkout@v6
with:
lfs: true
- uses: jdx/mise-action@v4
with:
experimental: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Check formatting (Swift + Markdown)
run: mise run format-check
- name: Lint (SwiftLint)
run: mise run lint
- name: Check llms.txt files are up to date
run: bash Scripts/generate-llms.sh && git diff --exit-code llms.txt llms-full.txt
build-macos:
name: Build & Test (macOS)
runs-on: macos-15
needs: lint
env:
DEVELOPER_DIR: "/Applications/Xcode_26.2.app/Contents/Developer"
steps:
- uses: actions/checkout@v6
with:
lfs: true
- name: Install Swift 6.3 toolchain
run: |
curl -fLo swift-6.3.pkg "https://download.swift.org/swift-6.3-release/xcode/swift-6.3-RELEASE/swift-6.3-RELEASE-osx.pkg"
sudo installer -pkg swift-6.3.pkg -target /
TOOLCHAINS=$(plutil -extract CFBundleIdentifier raw /Library/Developer/Toolchains/swift-6.3-RELEASE.xctoolchain/Info.plist)
echo "TOOLCHAINS=$TOOLCHAINS" >> "$GITHUB_ENV"
- name: Cache SPM dependencies
uses: actions/cache@v5
with:
path: .build
key: ${{ runner.os }}-swift-6.3-spm-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-6.3-spm-
- uses: jdx/mise-action@v4
with:
experimental: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify pkl installation
run: pkl --version
- name: Show Swift version
run: swift --version
- name: Build (including tests)
run: swift build --build-tests 2>&1 | xcsift
- name: Test
run: swift test --skip-build --parallel 2>&1 | xcsift
build-linux:
name: Build & Test (Linux)
runs-on: ubuntu-latest
needs: lint
container:
image: swift:6.3-jammy
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y git-lfs curl
git lfs install
- uses: actions/checkout@v6
with:
lfs: true
- name: Cache SPM dependencies
uses: actions/cache@v5
with:
path: .build
key: ${{ runner.os }}-swift-6.3-spm-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-6.3-spm-
- uses: jdx/mise-action@v4
with:
experimental: true
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install tools (xcsift, pkl)
run: |
mise install xcsift pkl
mise where xcsift >> "$GITHUB_PATH"
mise where pkl >> "$GITHUB_PATH"
- name: Verify pkl installation
run: pkl --version
- name: Show Swift version
run: swift --version
- name: Build (including tests)
run: swift build --build-tests 2>&1 | xcsift
- name: Run tests
# Build tests separately to avoid hangs from concurrent build + test execution
run: swift test --skip-build --parallel 2>&1 | xcsift
build-windows:
name: Build (Windows)
runs-on: windows-latest
needs: lint
steps:
- uses: actions/checkout@v6
- name: Install Swift
uses: compnerd/gha-setup-swift@v0.3.0
with:
branch: swift-6.3-release
tag: 6.3-RELEASE
- name: Cache SPM dependencies
uses: actions/cache@v5
with:
path: .build
key: ${{ runner.os }}-swift-6.3-spm-${{ hashFiles('Package.swift', 'Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-6.3-spm-
- name: Swift version
run: swift --version
- name: Resolve dependencies
run: swift package resolve
- name: Build (Debug)
run: swift build