83
83
with :
84
84
name : macos-test-results
85
85
path : ./swift-test-results.tar.gz
86
+
86
87
macos_smoke_test :
87
- name : Compile hello.swift on macOS
88
+ name : Run smoke tests on macOS
88
89
runs-on : macos-latest
89
90
needs : macos_build
90
91
steps :
@@ -97,16 +98,60 @@ jobs:
97
98
run : |
98
99
set -x
99
100
tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
100
- TOOLCHAIN_PATH=$(find . -name "swift-wasm-*" -type d)
101
+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
101
102
echo 'print("Hello, world!")' > hello.swift
102
103
$TOOLCHAIN_PATH/usr/bin/swiftc \
103
104
-target wasm32-unknown-wasi \
104
105
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
105
106
hello.swift -o hello.wasm && \
106
107
echo "Successfully linked hello.wasm"
107
-
108
+ - name : Test SwiftPM
109
+ shell : bash
110
+ run : |
111
+ set -x
112
+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
113
+ mkdir test
114
+ cd test
115
+ $TOOLCHAIN_PATH/usr/bin/swift package init
116
+ $TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
108
117
- name : Upload hello.wasm compiled with macOS package
109
118
uses : actions/upload-artifact@v1
110
119
with :
111
120
name : macos-hello.wasm
112
121
path : hello.wasm
122
+
123
+ linux_smoke_test :
124
+ name : Run smoke tests on Linux
125
+ runs-on : ubuntu-18.04
126
+ needs : linux_build
127
+ steps :
128
+ - name : Download installable Linux archive
129
+ uses : actions/download-artifact@v1
130
+ with :
131
+ name : linux-installable
132
+ - name : Build hello.wasm
133
+ shell : bash
134
+ run : |
135
+ set -x
136
+ tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
137
+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
138
+ echo 'print("Hello, world!")' > hello.swift
139
+ $TOOLCHAIN_PATH/usr/bin/swiftc \
140
+ -target wasm32-unknown-wasi \
141
+ -sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
142
+ hello.swift -o hello.wasm && \
143
+ echo "Successfully linked hello.wasm"
144
+ - name : Test SwiftPM
145
+ shell : bash
146
+ run : |
147
+ set -x
148
+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
149
+ mkdir test
150
+ cd test
151
+ $TOOLCHAIN_PATH/usr/bin/swift package init
152
+ $TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
153
+ - name : Upload hello.wasm compiled with Linux package
154
+ uses : actions/upload-artifact@v1
155
+ with :
156
+ name : linux-hello.wasm
157
+ path : hello.wasm
0 commit comments