diff --git a/.github/workflows/Android.yml b/.github/workflows/Android.yml index 100f051f..f23951bd 100644 --- a/.github/workflows/Android.yml +++ b/.github/workflows/Android.yml @@ -4,22 +4,49 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Android.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Android.yml' + +concurrency: + group: android-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-Linux-Android: runs-on: ubuntu-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Install Swift 6.2 uses: swift-actions/setup-swift@v2 with: swift-version: "6.2" - name: Install Android SDK + # The old swift-5.8-android-24-sdk destination bundle is incompatible with the Swift + # toolchain now preinstalled on ubuntu-latest (6.x): its sysroot doesn't resolve against + # the newer compiler's search paths (missing stdio.h/inttypes.h). Use the modern + # `swift sdk install` artifact-bundle flow with a matching Swift 6.2 toolchain instead of + # the legacy `--destination` JSON file, matching the same fix already validated on the + # swift-6-migration branch. run: | swift sdk install https://github.com/finagolfin/swift-android-sdk/releases/download/6.2/swift-6.2-RELEASE-android-24-0.1.artifactbundle.tar.gz --checksum c26ebfd4e32c0ca1beabcc45729b62042da57ee76d7d043f63f2235da90dc491 @@ -30,9 +57,11 @@ jobs: run: swift --version - name: Build using Swift - # ANDROID_NDK_ROOT must be unset for the SDK to function properly - # (GitHub Actions runners have this set by default) - # Only build Android-compatible targets (GateEngine has #error for Android) + # (GitHub Actions runners have this set by default). + # Only build Android-portable targets: Gravity (vendored C, uses bzero/glibc-only headers) + # and OpenALSoft (no Android config.h/backend) are not portable to Android's Bionic libc + # and are excluded from the cross-compiled build here, matching the same scoping already + # validated on the swift-6-migration branch. env: ANDROID_NDK_ROOT: "" run: swift build --target GameMath --target GateUtilities --swift-sdk aarch64-unknown-linux-android24 diff --git a/.github/workflows/HTML5.yml b/.github/workflows/HTML5.yml index 4f96afb2..ba2fb108 100644 --- a/.github/workflows/HTML5.yml +++ b/.github/workflows/HTML5.yml @@ -4,17 +4,38 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/HTML5.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/HTML5.yml' + +concurrency: + group: html5-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-macOS-WASI: runs-on: macos-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Install Swift uses: swift-actions/setup-swift@v2 with: @@ -34,7 +55,7 @@ jobs: - name: Build for WASI # Use the standard SDK, not the embedded one (embedded lacks Codable/Foundation) run: swift build --swift-sdk 6.2-RELEASE-wasm32-unknown-wasip1 --traits HTML5 - + # - name: Archive # uses: actions/upload-artifact@v3 # if: always() @@ -45,6 +66,6 @@ jobs: # TODO: Figure out how to make chrome default without a confirmation # - name: Make Chrome Default # run: open -a "Google Chrome" --args --make-default-browser -# +# # - name: Test Secure Context # run: carton test --environment defaultBrowser --host localhost diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 1fe11278..1f8dbca0 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -5,17 +5,38 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Linux.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Linux.yml' + +concurrency: + group: linux-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-Linux-Linux: runs-on: ubuntu-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: Install Swift 6.2 uses: swift-actions/setup-swift@v2 @@ -27,7 +48,7 @@ jobs: - name: Swift Version run: swift --version - + - name: Build run: swift build - name: Test diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 925dfe04..d65aaff8 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -4,23 +4,47 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Windows.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Windows.yml' + +concurrency: + group: windows-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-Windows-Windows: runs-on: windows-latest + timeout-minutes: 30 steps: - uses: compnerd/gha-setup-swift@main with: + # GateEngine's swift-tools-version requires a matching toolchain; the 5.10 install + # previously caused SwiftPM to refuse the manifest. Use the non-deprecated + # swift-version/swift-build inputs at 6.2 (matching the toolchain validated on main). swift-version: swift-6.2-release swift-build: 6.2-RELEASE - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Swift Version run: swift --version - + - name: Build run: swift build -v -j 1 -Xlinker /VERBOSE - name: Test diff --git a/.github/workflows/iOS-tvOS.yml b/.github/workflows/iOS-tvOS.yml index 705c1c34..993e3d04 100644 --- a/.github/workflows/iOS-tvOS.yml +++ b/.github/workflows/iOS-tvOS.yml @@ -6,12 +6,25 @@ on: pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/iOS-tvOS.yml' + +concurrency: + group: ios-tvos-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-macOS-iOS: runs-on: macos-15 + timeout-minutes: 30 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Select Xcode version run: sudo xcode-select -s '/Applications/Xcode_26.1.app/Contents/Developer' diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 51280e16..c2ef1072 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -6,26 +6,39 @@ on: pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/macOS.yml' + +concurrency: + group: macos-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-macOS-macOS: runs-on: macos-15 + timeout-minutes: 45 steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v5 + - name: Select Xcode version run: sudo xcode-select -s '/Applications/Xcode_26.1.app/Contents/Developer' - + - name: Swift Version run: swift --version - + - name: Build using Swift x86_64 run: swift build --triple x86_64-apple-macos - name: Build using Swift arm64 run: swift build --triple arm64-apple-macos - name: Test using Swift run: swift test - + - name: Build using Xcode run: xcodebuild -scheme GateEngine ONLY_ACTIVE_ARCH=NO -destination platform=macOS -configuration Release - name: Test using Xcode