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