forked from Cocoanetics/SwiftScript
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (126 loc) · 4.67 KB
/
Copy pathswift.yml
File metadata and controls
133 lines (126 loc) · 4.67 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
---
name: Swift
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Cancel earlier runs of this workflow on the same branch as soon as
# a new commit comes in — Windows in particular is slow (~10 min for
# swift-syntax + bridges from scratch on a cold runner) and stacking
# runs wastes a CI capacity.
concurrency:
group: swift-${{ github.ref }}
cancel-in-progress: true
jobs:
build-macos:
# `macos-26` runner is required: the package targets `.macOS("26.0")`
# and the auto-generated Foundation bridges call macOS-26-only APIs
# unconditionally, so the test bundle dyld-refuses on older runners.
runs-on: macos-26
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
- name: Select Xcode 26.0
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.0"
- name: Verify Swift version
run: swift --version
- name: Build (macOS)
run: swift build --build-tests -v
- name: Test (macOS)
run: swift test -v --skip-build
build-ios:
runs-on: macos-26
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Select Xcode 26.0
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.0"
# `macos-26` ships with Xcode 26 but the iOS 26 simulator runtime
# isn't preinstalled — `xcodebuild` lists the iOS destination as
# "Ineligible: iOS 26.0 is not installed". Pull it down before
# the build step. Adds ~5 min on first run.
- name: Install iOS Simulator runtime
run: sudo xcodebuild -downloadPlatform iOS
# Use the auto-generated `<Package>-Package` umbrella scheme —
# the library scheme `SwiftScriptInterpreter` doesn't define a
# test action. Split build/test into two steps so the Actions UI
# shows where time is spent (matches the macOS / Linux pattern).
- name: Build (iOS Simulator)
run: |
xcodebuild build-for-testing \
-scheme SwiftScript-Package \
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 17' \
-skipPackagePluginValidation
- name: Test (iOS Simulator)
run: |
xcodebuild test-without-building \
-scheme SwiftScript-Package \
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 17' \
-skipPackagePluginValidation
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
# Bumped from 6.0 → 6.3 to stay aligned with the swift-foundation
# revision the scl extract is generated from. Older toolchains'
# bundled Foundation lags behind scl's HEAD and trips bridge
# entries that scl reports as cross-platform.
image: swift:6.3-jammy
steps:
- uses: actions/checkout@v6
- name: Verify Swift version
run: swift --version
- name: Build (Linux)
run: swift build --build-tests -v
- name: Test (Linux)
run: swift test -v --skip-build
build-windows:
runs-on: windows-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
# SwiftyLab/setup-swift is the unified macOS/Linux/Windows
# toolchain installer. Pin to a specific patch so the version
# is deterministic across runs.
- name: Setup Swift
uses: SwiftyLab/setup-swift@latest
with:
swift-version: "6.3.1"
- name: Verify Swift version
run: swift --version
- name: Build (Windows)
run: swift build --build-tests -v
- name: Test (Windows)
run: swift test -v --skip-build
# Uses skiptools/swift-android-action which wraps the swift.org Android
# SDK setup AND runs the SwiftPM tests on an x86_64 Android emulator.
# No `container:` here — the action provisions its own toolchain and
# the emulator setup needs nested KVM, which only works on the bare
# ubuntu-* runner image.
#
# Single invocation by design: the action's avd-cache and emulator
# launch are gated on `build-package == true && build-tests == true`,
# so a separate "test-only" step (build-package:false) silently skips
# the emulator entirely. Build and test timing is still visible
# inside the action's expanded step list.
build-android:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- name: Build & test (Android emulator)
uses: skiptools/swift-android-action@v2
with:
swift-version: "6.3"
# The default GitHub Linux runner has ~14 GiB free; the SDK,
# NDK, and emulator together push past that without cleanup.
free-disk-space: true