Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/workflows/buildroot.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/swift-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Swift Android

on: [push]

jobs:
android:
name: Android (unit tests)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Cross-compiles the package for Android and runs the XCTest suite on an
# Android emulator (x86_64) provisioned by the action.
- name: Build and test on Android emulator
uses: skiptools/swift-android-action@v2
with:
swift-version: 6.3.3

android-armv7:
name: Android (armv7 cross-compile)
runs-on: ubuntu-latest
container: swift:6.3.3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: apt-get update -y && apt-get install -y curl
- name: Install Swift Android SDK
# The Android SDK artifact bundle is only published for 6.3.3, and the
# host toolchain must match the bundle version exactly (Swift's module
# format isn't cross-patch-compatible) — hence the swift:6.3.3 container.
run: |
set -eux
url="https://download.swift.org/swift-6.3.3-release/android-sdk/swift-6.3.3-RELEASE/swift-6.3.3-RELEASE_android.artifactbundle.tar.gz"
curl -fsSL "$url" -o android.artifactbundle.tar.gz
swift sdk install android.artifactbundle.tar.gz \
--checksum d160cc3206dd1886dae3fef2337af5e25ec034692cd0ec225721c56cc69da7f5
swift sdk list
# armv7 can't run on the x86_64 emulator, so this is a cross-compile check
# only. The bundle installs as a single multi-arch SDK; the architecture is
# selected by target triple. Read the exact armv7 triple (with its
# API-level suffix) from the installed SDK metadata rather than pinning it.
- name: Build (armv7)
run: |
set -eux
TRIPLE=$(grep -rhoE 'armv7-unknown-linux-androideabi[0-9]*' ~/.swiftpm | sort -u | head -1)
test -n "$TRIPLE"
echo "Using target triple: $TRIPLE"
swift build --swift-sdk "$TRIPLE"
24 changes: 0 additions & 24 deletions .github/workflows/swift-arm.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/swift-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Swift Windows

on: [push]

jobs:
windows:
name: Windows
runs-on: windows-latest
steps:
- uses: compnerd/gha-setup-swift@main
with:
branch: swift-6.3.3-release
tag: 6.3.3-RELEASE
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: swift build
- name: Test
run: swift test
80 changes: 50 additions & 30 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,68 @@ name: Swift
on: [push]

jobs:
mac:
macos:
name: macOS
runs-on: macos-26
strategy:
matrix:
swift: [5.7.3]
os: [macos-latest]
runs-on: ${{ matrix.os }}
config: ["debug", "release"]
steps:
- name: Install Swift
uses: slashmo/install-swift@v0.3.0
with:
version: ${{ matrix.swift }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build (Debug)
run: swift build -c debug
- name: Build (Release)
run: swift build -c release
- name: Test (Debug)
run: swift test --configuration debug
- name: Build
run: swift build -c ${{ matrix.config }}
- name: Test
run: swift test -c ${{ matrix.config }}

linux:
name: Linux
name: Linux (${{ matrix.container }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift: [5.1.5, 5.5, 5.6.3, 5.7.3]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
container: ["swift:latest", "swiftlang/swift:nightly-noble"]
config: ["debug", "release"]
container: ${{ matrix.container }}
steps:
- name: Install Swift
uses: slashmo/install-swift@v0.3.0
with:
version: ${{ matrix.swift }}
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build (Debug)
run: swift build -c debug
- name: Build (Release)
run: swift build -c release
- name: Test (Debug)
run: swift test --configuration debug
- name: Build
run: swift build -c ${{ matrix.config }}
- name: Test
run: swift test -c ${{ matrix.config }}

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 70
- 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
# the repo might not have the feature enabled, so a failed upload
# doesn't break CI. Remove once GA is enabled everywhere.
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
Loading
Loading