Update unit tests #29
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: | |
| fail-fast: false | |
| matrix: | |
| config: ["debug", "release"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Swift Version | |
| run: swift --version | |
| - name: Build | |
| run: swift build -c ${{ matrix.config }} | |
| - name: Test | |
| run: 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"] | |
| container: ${{ matrix.container }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Swift Version | |
| run: swift --version | |
| - name: Build | |
| run: swift build -c ${{ matrix.config }} | |
| - name: Test | |
| run: 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 CoreModelSQLite | |
| android: | |
| name: Android | |
| runs-on: macos-15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: ["debug", "release"] | |
| env: | |
| SWIFT_VERSION: "6.3.2" | |
| ANDROID_NDK_VERSION: "27.2.12479018" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Swift | |
| run: | | |
| curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg | |
| installer -pkg swiftly.pkg -target CurrentUserHomeDirectory | |
| ~/.swiftly/bin/swiftly init --assume-yes --skip-install | |
| echo "$HOME/.swiftly/bin" >> "$GITHUB_PATH" | |
| source ~/.swiftly/env.sh | |
| swiftly install ${{ env.SWIFT_VERSION }} | |
| swiftly use ${{ env.SWIFT_VERSION }} | |
| echo "$(swiftly use --print-location)/usr/bin" >> "$GITHUB_PATH" | |
| - name: Install Android NDK | |
| run: $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.ANDROID_NDK_VERSION }}" | |
| - name: Install Swift SDK for Android | |
| run: | | |
| curl -L -o android-sdk.artifactbundle.tar.gz "https://download.swift.org/swift-${{ env.SWIFT_VERSION }}-release/android-sdk/swift-${{ env.SWIFT_VERSION }}-RELEASE/swift-${{ env.SWIFT_VERSION }}-RELEASE_android.artifactbundle.tar.gz" | |
| CHECKSUM=$(swift package compute-checksum android-sdk.artifactbundle.tar.gz) | |
| swift sdk install android-sdk.artifactbundle.tar.gz --checksum "$CHECKSUM" | |
| ANDROID_NDK_HOME="$ANDROID_HOME/ndk/${{ env.ANDROID_NDK_VERSION }}" \ | |
| bash "$HOME/Library/org.swift.swiftpm/swift-sdks/swift-${{ env.SWIFT_VERSION }}-RELEASE_android.artifactbundle/swift-android/scripts/setup-android-sdk.sh" | |
| - name: Build | |
| run: TARGET_OS_ANDROID=1 swift build --swift-sdk aarch64-unknown-linux-android28 -c ${{ matrix.config }} | |
| ios: | |
| name: iOS | |
| runs-on: macos-26 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: ["debug", "release"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Simulator | |
| run: | | |
| DEVICE_ID=$(xcrun simctl list devices available -j | python3 -c "import json,sys; d=json.load(sys.stdin)['devices']; devices=[v for vs in d.values() for v in vs if 'iPhone' in v['name']]; print(devices[0]['udid'])") | |
| echo "DEVICE_ID=${DEVICE_ID}" >> "$GITHUB_ENV" | |
| - name: Build | |
| run: > | |
| xcodebuild build -scheme CoreModel-SQLite | |
| -destination "generic/platform=iOS" | |
| -configuration ${{ matrix.config == 'release' && 'Release' || 'Debug' }} | |
| -skipMacroValidation -skipPackagePluginValidation | |
| - name: Test | |
| run: > | |
| xcodebuild test -scheme CoreModel-SQLite | |
| -destination "id=${{ env.DEVICE_ID }}" | |
| -configuration ${{ matrix.config == 'release' && 'Release' || 'Debug' }} | |
| -skipMacroValidation -skipPackagePluginValidation | |
| ENABLE_TESTABILITY=YES | |
| android-test: | |
| name: Android Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Test on Android emulator | |
| uses: skiptools/swift-android-action@v2 | |
| with: | |
| swift-version: "6.3.2" | |
| android-api-level: 28 | |
| swift-configuration: debug | |
| free-disk-space: true | |
| run-tests: true |