Use grep instead of xpath to parse current Swift version #202
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-android-action ci | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
jobs: | |
builds: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-24.04', 'ubuntu-22.04', 'macos-13', 'macos-15'] | |
#swift-version: ['6.0', '6.1'] | |
swift-version: ['6.0', '6.1', '6.1.1', 'nightly-6.2'] | |
steps: | |
- name: Checkout Action | |
uses: actions/checkout@v4 | |
with: | |
path: swift-android-action | |
- name: Checkout jpsim/Yams | |
uses: actions/checkout@v4 | |
with: | |
repository: jpsim/Yams | |
path: jpsim/Yams | |
- name: Fix jpsim/Yams for Android | |
working-directory: jpsim/Yams | |
run: | | |
# Android tests that use measure have too high a stddev | |
perl -pi -e 's;self.measure ;do ;g' Tests/YamsTests/PerformanceTests.swift | |
- name: Test jpsim/Yams | |
uses: ./swift-android-action/ | |
with: | |
package-path: jpsim/Yams | |
swift-version: ${{ matrix.swift-version }} | |
run-tests: ${{ matrix.os != 'macos-15' }} # no tests on macOS ARM | |
copy-files: Tests | |
test-env: TEST_WORKSPACE=1 | |
- name: Checkout skiptools/swift-android-native | |
uses: actions/checkout@v4 | |
with: | |
repository: skiptools/swift-android-native | |
path: skiptools/swift-android-native | |
- name: Test skiptools/swift-android-native | |
uses: ./swift-android-action/ | |
with: | |
package-path: skiptools/swift-android-native | |
swift-version: ${{ matrix.swift-version }} | |
run-tests: ${{ matrix.os != 'macos-15' }} # no tests on macOS ARM | |
toolchain-setup: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-24.04', 'ubuntu-22.04', 'macos-13', 'macos-15'] | |
swift-version: ['6.0', '6.1', 'nightly-6.2'] | |
steps: | |
- name: Checkout Action | |
uses: actions/checkout@v4 | |
with: | |
path: swift-android-action | |
- name: Setup NDK | |
if: ${{ matrix.os == 'macos-13' }} # macOS-13 defaults to NDK 16, NDK 17+ needed | |
run: | | |
echo "ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk/27.2.12479018" >> $GITHUB_ENV | |
- name: Setup Toolchain | |
id: setup-toolchain | |
uses: ./swift-android-action/ | |
#uses: skiptools/swift-android-action@v2 | |
with: | |
# just set up the toolchain and don't build anything | |
build-package: false | |
swift-version: ${{ matrix.swift-version }} | |
- name: Checkout apple/swift-numerics | |
uses: actions/checkout@v4 | |
with: | |
repository: apple/swift-numerics | |
path: apple/swift-numerics | |
- name: Build Package With Toolchain | |
working-directory: apple/swift-numerics | |
run: | | |
echo "SWIFT COMMAND: ${{ steps.setup-toolchain.outputs.swift-build }}" | |
${{ steps.setup-toolchain.outputs.swift-build }} -c debug | |
ls -la .build/${{ steps.setup-toolchain.outputs.swift-sdk }}/debug | |
${{ steps.setup-toolchain.outputs.swift-build }} -c release | |
ls -la .build/${{ steps.setup-toolchain.outputs.swift-sdk }}/release | |