-
Notifications
You must be signed in to change notification settings - Fork 5
145 lines (139 loc) · 4.82 KB
/
Copy pathswift.yml
File metadata and controls
145 lines (139 loc) · 4.82 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
name: Swift
on: [push]
jobs:
macos:
name: macOS
runs-on: macos-26
strategy:
matrix:
config: ["debug", "release"]
options: ["", "SWIFT_BUILD_DYNAMIC_LIBRARY=1"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: ${{ matrix.options }} swift build -c ${{ matrix.config }}
- name: Test
run: ${{ matrix.options }} swift test -c ${{ matrix.config }} --no-parallel
coverage:
name: Code Coverage
runs-on: macos-26
permissions:
contents: read
code-quality: write # required by actions/upload-code-coverage
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Export coverage and enforce threshold
run: Scripts/coverage.sh 90
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: .build/coverage/coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
- name: Upload coverage to GitHub Code Quality
uses: actions/upload-code-coverage@v1
with:
file: .build/coverage/coverage.xml
language: Swift
label: code-coverage/llvm-cov
# Code Quality was in public preview until 2026-07-20; keep this while
# any target repo might not have the feature enabled, so a failed upload
# doesn't break CI. Remove once every consumer is on GA.
fail-on-error: false
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: .build/coverage/
if-no-files-found: error
linux:
name: Linux (${{ matrix.container }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: ["swift:latest", "swiftlang/swift:nightly-noble"]
config: ["debug", "release"]
options: ["", "SWIFT_BUILD_DYNAMIC_LIBRARY=1"]
container: ${{ matrix.container }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: ${{ matrix.options }} swift build -c ${{ matrix.config }}
- name: Test
run: ${{ matrix.options }} swift test -c ${{ matrix.config }} --no-parallel
skip-fuse:
name: Skip Fuse (Android)
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build (Skip Fuse)
run: SKIP_FUSE=1 swift build --target CoreModel
android:
name: Android
strategy:
fail-fast: false
matrix:
swift: ['6.3.2']
arch: ["aarch64", "x86_64"]
runs-on: macos-26
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: "Build Swift Package for Android"
run: |
brew install skiptools/skip/skip || (brew update && brew install skiptools/skip/skip)
skip android sdk install --version ${{ matrix.swift }}
ANDROID_NDK_ROOT="" skip android build --arch ${{ matrix.arch }}
android-sdk:
name: Android (Swift SDK, ${{ matrix.triple }})
runs-on: ubuntu-latest
container: swift:6.3.2
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
triple: ["aarch64-unknown-linux-android28", "x86_64-unknown-linux-android28"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Install dependencies
run: apt-get update -y && apt-get install -y curl unzip
- name: Install Android Swift SDK
run: |
set -eux
url="https://download.swift.org/swift-6.3.2-release/android-sdk/swift-6.3.2-RELEASE/swift-6.3.2-RELEASE_android.artifactbundle.tar.gz"
curl -fsSL "$url" -o android.artifactbundle.tar.gz
swift sdk install android.artifactbundle.tar.gz
swift sdk list
- name: Install and configure the Android NDK
run: |
set -eux
unset ANDROID_NDK_ROOT
sdk_dir="$(find / -maxdepth 8 -type d -path '*swift-6.3.2-RELEASE_android.artifactbundle/swift-android' 2>/dev/null | head -1)"
test -n "$sdk_dir"
cd "$sdk_dir"
curl -fSL -o ndk.zip "https://dl.google.com/android/repository/android-ndk-r27d-Linux.zip"
unzip -qo ndk.zip
echo "ANDROID_NDK_HOME=$PWD/android-ndk-r27d" >> "$GITHUB_ENV"
ANDROID_NDK_HOME="$PWD/android-ndk-r27d" ./scripts/setup-android-sdk.sh
- name: Build
run: |
set -eux
unset ANDROID_NDK_ROOT
swift build --swift-sdk ${{ matrix.triple }} --static-swift-stdlib