-
-
Notifications
You must be signed in to change notification settings - Fork 47
88 lines (85 loc) · 3.9 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Run unit tests
on:
pull_request:
push:
branches: [main]
jobs:
test:
name: Build and Test
strategy:
matrix:
entry:
# Ensure that all host can install toolchain, build project, and run tests
- { os: macos-12, toolchain: wasm-5.9.1-RELEASE, wasi-backend: Node, xcode: Xcode_13.4.1.app }
- { os: macos-13, toolchain: wasm-5.9.1-RELEASE, wasi-backend: Node, xcode: Xcode_14.3.app }
- { os: macos-14, toolchain: wasm-5.9.1-RELEASE, wasi-backend: Node, xcode: Xcode_15.2.app }
- { os: ubuntu-22.04, toolchain: wasm-5.9.1-RELEASE, wasi-backend: Node }
- { os: ubuntu-22.04, toolchain: wasm-5.10.0-RELEASE, wasi-backend: Node }
# Ensure that test succeeds with all toolchains and wasi backend combinations
- { os: ubuntu-20.04, toolchain: wasm-5.8.0-RELEASE, wasi-backend: Node }
- { os: ubuntu-20.04, toolchain: wasm-5.10.0-RELEASE, wasi-backend: Node }
- { os: ubuntu-20.04, toolchain: wasm-5.8.0-RELEASE, wasi-backend: MicroWASI }
- { os: ubuntu-20.04, toolchain: wasm-5.9.1-RELEASE, wasi-backend: MicroWASI }
- { os: ubuntu-20.04, toolchain: wasm-5.10.0-RELEASE, wasi-backend: MicroWASI }
- os: ubuntu-22.04
toolchain: DEVELOPMENT-SNAPSHOT-2024-06-13-a
swift-sdk:
id: DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasi
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasi.artifactbundle.zip"
wasi-backend: Node
- os: ubuntu-22.04
toolchain: DEVELOPMENT-SNAPSHOT-2024-06-13-a
swift-sdk:
id: DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasip1-threads
download-url: "https://github.com/swiftwasm/swift/releases/download/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a/swift-wasm-DEVELOPMENT-SNAPSHOT-2024-06-14-a-wasm32-unknown-wasip1-threads.artifactbundle.zip"
wasi-backend: Node
runs-on: ${{ matrix.entry.os }}
env:
JAVASCRIPTKIT_WASI_BACKEND: ${{ matrix.entry.wasi-backend }}
SWIFT_VERSION: ${{ matrix.entry.toolchain }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Select SDKROOT
if: ${{ matrix.entry.xcode }}
run: sudo xcode-select -s /Applications/${{ matrix.entry.xcode }}
- uses: swiftwasm/setup-swiftwasm@v1
if: ${{ matrix.entry.swift-sdk == null }}
with:
swift-version: ${{ matrix.entry.toolchain }}
- uses: ./.github/actions/install-swift
if: ${{ matrix.entry.swift-sdk }}
with:
swift-dir: development/ubuntu2204
swift-version: swift-${{ matrix.entry.toolchain }}
- name: Install Swift SDK
if: ${{ matrix.entry.swift-sdk }}
run: |
swift sdk install "${{ matrix.entry.swift-sdk.download-url }}"
echo "SWIFT_SDK_ID=${{ matrix.entry.swift-sdk.id }}" >> $GITHUB_ENV
- run: make bootstrap
- run: make test
- run: make unittest
# Skip unit tests with uwasi because its proc_exit throws
# unhandled promise rejection.
if: ${{ matrix.entry.wasi-backend != 'MicroWASI' }}
- name: Check if SwiftPM resources are stale
run: |
make regenerate_swiftpm_resources
git diff --exit-code Sources/JavaScriptKit/Runtime
native-build:
# Check native build to make it easy to develop applications by Xcode
name: Build for native target
strategy:
matrix:
include:
- os: macos-14
xcode: Xcode_15.2
- os: macos-15
xcode: Xcode_16
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: swift build
env:
DEVELOPER_DIR: /Applications/${{ matrix.xcode }}.app/Contents/Developer/