@@ -44,23 +44,35 @@ jobs:
44
44
build-linux :
45
45
strategy :
46
46
matrix :
47
- swift :
48
- - " 5.8-focal"
49
- - " 5.8-amazonlinux2"
50
- - " 5.9-focal"
51
- - " 5.9-amazonlinux2"
47
+ include :
48
+ - swift : " 5.8-focal"
49
+ swiftwasm-download : " https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.8.0-RELEASE/swift-wasm-5.8.0-RELEASE-ubuntu20.04_x86_64.tar.gz"
50
+ - swift : " 5.8-amazonlinux2"
51
+ swiftwasm-download : " https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.8.0-RELEASE/swift-wasm-5.8.0-RELEASE-amazonlinux2_x86_64.tar.gz"
52
+ - swift : " 5.9-focal"
53
+ swiftwasm-download : " https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.9.2-RELEASE/swift-wasm-5.9.2-RELEASE-ubuntu20.04_x86_64.tar.gz"
54
+ - swift : " 5.9-amazonlinux2"
55
+ swiftwasm-download : " https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.9.2-RELEASE/swift-wasm-5.9.2-RELEASE-amazonlinux2_x86_64.tar.gz"
52
56
53
- container :
54
- image : swift:${{ matrix.swift }}
55
57
runs-on : ubuntu-20.04
58
+ name : " build-linux (${{ matrix.swift }})"
56
59
57
60
steps :
58
61
- uses : actions/checkout@v3
59
- - id : setup-swiftwasm
60
- uses : swiftwasm/setup-swiftwasm@v1
61
- with :
62
- swift-version : " wasm-5.8.0-RELEASE"
63
- add-to-path : false
62
+ - name : Configure container
63
+ run : |
64
+ docker run -dit --name build-container -v $PWD:/workspace -w /workspace swift:${{ matrix.swift }}
65
+ echo 'docker exec -i build-container "$@"' > ./build-exec
66
+ chmod +x ./build-exec
67
+
68
+ - name : Install WebAssembly toolchain
69
+ id : setup-swiftwasm
70
+ run : |
71
+ toolchain_path="/opt/swiftwasm"
72
+ ./build-exec mkdir -p "$toolchain_path"
73
+ curl -L ${{ matrix.swiftwasm-download }} | ./build-exec tar xz --strip-component 1 -C "$toolchain_path"
74
+ echo "toolchain-path=$toolchain_path" >> $GITHUB_OUTPUT
75
+
64
76
- name : Configure Tests/default.json
65
77
run : |
66
78
cat <<EOS > Tests/default.json
69
81
"hostSwiftExecutablePath": "/usr/bin/swift"
70
82
}
71
83
EOS
72
- - run : swift test
73
- - run : ./CI/check-spectest.sh
74
- - run : ./CI/check-wasi-testsuite.sh
84
+ - run : ./build-exec swift test
85
+ - run : ./build-exec ./ CI/check-spectest.sh
86
+ - run : ./build-exec ./ CI/check-wasi-testsuite.sh
75
87
76
88
build-windows :
77
89
runs-on : windows-latest
0 commit comments