|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | macos: |
10 | | - runs-on: macos-latest |
| 10 | + runs-on: ${{ matrix.macos }} |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + macos: [macos-15, macos-15-intel, macos-26, macos-26-intel] |
| 14 | + swift: [6.3.2] |
11 | 15 | steps: |
12 | | - - uses: actions/checkout@v4 |
| 16 | + - uses: actions/checkout@v7 |
| 17 | + - name: Cache Swift Toolchain |
| 18 | + uses: actions/cache@v6 |
| 19 | + with: |
| 20 | + path: ~/.swiftly/toolchains |
| 21 | + key: swiftly-macos-${{ matrix.swift }}-${{ runner.os }} |
| 22 | + - name: Install Swift Toolchain |
| 23 | + run: | |
| 24 | + curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \ |
| 25 | + installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \ |
| 26 | + ~/.swiftly/bin/swiftly init --quiet-shell-followup && \ |
| 27 | + . "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \ |
| 28 | + hash -r |
| 29 | + echo "SWIFTLY_HOME_DIR=${SWIFTLY_HOME_DIR}" >> "${GITHUB_ENV}" |
| 30 | + echo "SWIFTLY_BIN_DIR=${SWIFTLY_BIN_DIR}" >> "${GITHUB_ENV}" |
| 31 | + swiftly install ${{ matrix.swift }} |
| 32 | + swiftly use ${{ matrix.swift }} |
13 | 33 | - name: Build |
14 | | - run: swift build --build-tests |
| 34 | + run: | |
| 35 | + . "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \ |
| 36 | + swift build --build-tests |
15 | 37 | - name: Run tests |
16 | | - run: swift test --parallel |
| 38 | + run: | |
| 39 | + . "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \ |
| 40 | + swift test --parallel |
17 | 41 |
|
18 | 42 | linux: |
19 | 43 | container: |
20 | | - image: swift:${{ matrix.linux }} |
21 | | - runs-on: ubuntu-latest |
| 44 | + image: swift:${{ matrix.swift }}-${{ matrix.linux }} |
| 45 | + runs-on: ${{ matrix.arch }} |
22 | 46 | strategy: |
23 | 47 | matrix: |
24 | | - linux: [focal, jammy, noble] |
| 48 | + linux: [jammy, noble] |
| 49 | + swift: [6.3.2] |
| 50 | + arch: [ubuntu-24.04-arm, ubuntu-24.04] |
25 | 51 | steps: |
26 | | - - uses: actions/checkout@v4 |
| 52 | + - uses: actions/checkout@v7 |
27 | 53 | - name: Build |
28 | 54 | run: swift build --build-tests --enable-test-discovery -Xswiftc -strict-concurrency=complete |
29 | 55 | - name: Test |
30 | 56 | run: swift test --enable-test-discovery --parallel -Xswiftc -strict-concurrency=complete |
31 | | - |
32 | | - android: |
33 | | - runs-on: macos-13 |
| 57 | + |
| 58 | + wasm: |
| 59 | + runs-on: ubuntu-latest |
34 | 60 | steps: |
35 | | - - name: Checkout |
36 | | - uses: actions/checkout@v4 |
37 | | - - name: Setup Environment |
38 | | - run: echo "ANDROID_NDK_HOME=${HOME}/Library/Android/sdk/ndk/27.2.12479018" >> $GITHUB_ENV |
39 | | - - name: Test |
40 | | - uses: skiptools/swift-android-action@v2 |
| 61 | + - uses: actions/checkout@v7 |
| 62 | + - name: Cache Swift Toolchain |
| 63 | + uses: actions/cache@v6 |
| 64 | + with: |
| 65 | + path: ~/.local/share/swiftly/toolchains |
| 66 | + key: swiftly-wasm-6.3.2-${{ runner.os }} |
| 67 | + - name: Install Swift Toolchain |
| 68 | + run: | |
| 69 | + curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \ |
| 70 | + tar zxf swiftly-$(uname -m).tar.gz && \ |
| 71 | + ./swiftly init --quiet-shell-followup && \ |
| 72 | + . "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh" && \ |
| 73 | + hash -r |
| 74 | + swiftly install 6.3.2 |
| 75 | + swiftly use 6.3.2 |
| 76 | + echo "SWIFTLY_HOME_DIR=${SWIFTLY_HOME_DIR}" >> "${GITHUB_ENV}" |
| 77 | + echo "SWIFTLY_BIN_DIR=${SWIFTLY_BIN_DIR}" >> "${GITHUB_ENV}" |
| 78 | + - name: Install WebAssembly Swift SDK |
| 79 | + run: swift sdk install https://download.swift.org/swift-6.3.2-release/wasm-sdk/swift-6.3.2-RELEASE/swift-6.3.2-RELEASE_wasm.artifactbundle.tar.gz --checksum a61f0584c93283589f8b2f42db05c1f9a182b506c2957271402992655591dd7c |
| 80 | + - name: Build for WebAssembly |
| 81 | + run: swift build --swift-sdk swift-6.3.2-RELEASE_wasm |
41 | 82 |
|
42 | | - # codecov: |
43 | | - # runs-on: macos-latest |
44 | | - # steps: |
45 | | - # - uses: actions/checkout@v4 |
46 | | - # - name: Test and generate code coverage report |
47 | | - # run: swift test --enable-code-coverage |
48 | | - # - name: Upload coverage to Codecov |
49 | | - # uses: codecov/codecov-action@v4 |
| 83 | + windows: |
| 84 | + runs-on: windows-latest |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v7 |
| 87 | + - name: Install Swift |
| 88 | + uses: compnerd/gha-setup-swift@main |
| 89 | + with: |
| 90 | + branch: swift-6.3.2-release |
| 91 | + tag: 6.3.2-RELEASE |
| 92 | + - name: Build |
| 93 | + run: swift build --build-tests |
| 94 | + - name: Run tests |
| 95 | + run: swift test --parallel |
0 commit comments