Skip to content

Commit 193999b

Browse files
committed
ci: GitHub Actions workflow for swift build + swift test on macos-15
Runs on every push to main and every PR targeting main. macos-15 runner gives Xcode 16 / Swift 6.x, sufficient for the package's `.macOS(.v13)` deployment target. - Concurrency group cancels in-flight runs when a follow-up push lands, saving CI minutes on rapid-fire fixes. - .build/ cache keyed on Package.resolved so dependency changes invalidate cleanly; everything else benefits from incremental compile. - 10-minute timeout per job (current full test run is ~10s; the budget is for cold-cache builds + future test growth). - No TDX credentials in the environment. The 2 RailIntegration tests XCTSkip cleanly when credentials are absent, so CI runs the full 70+ hermetic suite (MockURLProtocol covers HTTP behaviors that previously required network).
1 parent 4d8e13d commit 193999b

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# Lets a follow-up push cancel an in-flight run from the same branch — saves
10+
# minutes when the maintainer pushes a fix on top of an immediately-broken
11+
# commit.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
runs-on: macos-15
19+
timeout-minutes: 10
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Show toolchain
25+
run: |
26+
swift --version
27+
xcodebuild -version
28+
29+
# SwiftPM caches resolved dependencies and intermediate build products
30+
# under .build/. Keyed on Package.resolved so the cache invalidates
31+
# whenever a dependency version moves.
32+
- name: Cache .build
33+
uses: actions/cache@v4
34+
with:
35+
path: .build
36+
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
37+
restore-keys: |
38+
${{ runner.os }}-spm-
39+
40+
- name: Build
41+
run: swift build
42+
43+
- name: Test
44+
run: swift test
45+
env:
46+
# No TDX credentials are seeded in CI. The 2 RailIntegration
47+
# tests `XCTSkip` cleanly without them; the other 70+ run fully.
48+
# Setting this disables Auth.read's keychain prompt if it ever
49+
# leaks through (it shouldn't, but defense in depth).
50+
NSUnbufferedIO: "YES"

0 commit comments

Comments
 (0)