Merge pull request #22 from PureSwift/feature/functions #137
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} | |
| 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 }} | |
| 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 |