11
11
- swiftwasm-release/5.3
12
12
13
13
jobs :
14
- linux_build :
14
+ ubuntu1804_build :
15
15
timeout-minutes : 0
16
16
runs-on : ubuntu-18.04
17
17
@@ -39,19 +39,65 @@ jobs:
39
39
- uses : actions/cache@v1
40
40
with :
41
41
path : ../build-cache
42
- key : ${{ runner.os }} -sccache-v10-5.3-${{ steps.cache_timestamp.outputs.timestamp }}
42
+ key : ubuntu-18.04 -sccache-v10-5.3-${{ steps.cache_timestamp.outputs.timestamp }}
43
43
restore-keys : |
44
- ${{ runner.os }} -sccache-v10-5.3-
45
- - name : Build Linux installable archive
44
+ ubuntu-18.04 -sccache-v10-5.3-
45
+ - name : Build Ubuntu 18.04 installable archive
46
46
run : |
47
47
./utils/webassembly/ci.sh
48
48
echo "Cleanup build directory to free disk space"
49
49
rm -rf ../build
50
- - name : Upload Linux installable archive
50
+ - name : Upload 18.04 installable archive
51
+ uses : actions/upload-artifact@v1
52
+ with :
53
+ name : ubuntu18.04-installable
54
+ path : ../swift-wasm-5.3-SNAPSHOT-ubuntu18.04.tar.gz
55
+ # - name: Pack test results
56
+ # run: tar cJf swift-test-results.tar.gz ../build/*/swift-linux-x86_64/swift-test-results
57
+ # - name: Upload test results
58
+ # uses: actions/upload-artifact@v1
59
+ # with:
60
+ # name: linux-test-results
61
+ # path: ./swift-test-results.tar.gz
62
+
63
+ ubuntu2004_build :
64
+ timeout-minutes : 0
65
+ runs-on : ubuntu-20.04
66
+
67
+ steps :
68
+ - name : Free disk space
69
+ run : |
70
+ df -h
71
+ sudo swapoff -a
72
+ sudo rm -f /swapfile
73
+ sudo rm -rf /opt/hostedtoolcache
74
+ sudo rm -rf /usr/share/dotnet
75
+ sudo apt clean
76
+ docker rmi $(docker image ls -aq)
77
+ df -h
78
+ - uses : actions/checkout@v1
79
+ with :
80
+ path : swift
81
+ - name : Prepare sccache timestamp
82
+ id : cache_timestamp
83
+ shell : cmake -P {0}
84
+ run : |
85
+ string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
86
+ message("::set-output name=timestamp::${current_date}")
87
+ - uses : actions/cache@v1
88
+ with :
89
+ path : ../build-cache
90
+ key : ubuntu-20.04-sccache-v10-5.3-${{ steps.cache_timestamp.outputs.timestamp }}
91
+ restore-keys : |
92
+ ubuntu-20.04-sccache-v10-5.3-
93
+ - name : Build Ubuntu 20.04 installable archive
94
+ run : |
95
+ ./utils/webassembly/ci.sh
96
+ - name : Upload Ubuntu 20.04 installable archive
51
97
uses : actions/upload-artifact@v1
52
98
with :
53
- name : linux -installable
54
- path : ../swift-wasm-5.3-SNAPSHOT-linux .tar.gz
99
+ name : ubuntu20.04 -installable
100
+ path : ../swift-wasm-5.3-SNAPSHOT-ubuntu20.04 .tar.gz
55
101
# - name: Pack test results
56
102
# run: tar cJf swift-test-results.tar.gz ../build/*/swift-linux-x86_64/swift-test-results
57
103
# - name: Upload test results
@@ -138,15 +184,51 @@ jobs:
138
184
name : macos-hello.wasm
139
185
path : hello.wasm
140
186
141
- linux_smoke_test :
142
- name : Run smoke tests on Linux
187
+ ubuntu1804_smoke_test :
188
+ name : Run smoke tests on Ubuntu 18.04
143
189
runs-on : ubuntu-18.04
144
- needs : linux_build
190
+ needs : ubuntu1804_build
191
+ steps :
192
+ - name : Download installable Ubuntu 18.04 archive
193
+ uses : actions/download-artifact@v1
194
+ with :
195
+ name : ubuntu18.04-installable
196
+ - name : Build hello.wasm
197
+ shell : bash
198
+ run : |
199
+ set -x
200
+ tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
201
+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
202
+ echo 'print("Hello, world!")' > hello.swift
203
+ $TOOLCHAIN_PATH/usr/bin/swiftc \
204
+ -target wasm32-unknown-wasi \
205
+ -sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
206
+ hello.swift -o hello.wasm && \
207
+ echo "Successfully linked hello.wasm"
208
+ - name : Test SwiftPM
209
+ shell : bash
210
+ run : |
211
+ set -x
212
+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
213
+ mkdir test
214
+ cd test
215
+ $TOOLCHAIN_PATH/usr/bin/swift package init
216
+ $TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
217
+ - name : Upload hello.wasm compiled with Ubuntu 18.04 package
218
+ uses : actions/upload-artifact@v1
219
+ with :
220
+ name : ubuntu18.04-hello.wasm
221
+ path : hello.wasm
222
+
223
+ ubuntu2004_smoke_test :
224
+ name : Run smoke tests on Ubuntu 20.04
225
+ runs-on : ubuntu-20.04
226
+ needs : ubuntu2004_build
145
227
steps :
146
- - name : Download installable Linux archive
228
+ - name : Download installable Ubuntu 20.04 archive
147
229
uses : actions/download-artifact@v1
148
230
with :
149
- name : linux -installable
231
+ name : ubuntu20.04 -installable
150
232
- name : Build hello.wasm
151
233
shell : bash
152
234
run : |
@@ -168,8 +250,8 @@ jobs:
168
250
cd test
169
251
$TOOLCHAIN_PATH/usr/bin/swift package init
170
252
$TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
171
- - name : Upload hello.wasm compiled with Linux package
253
+ - name : Upload hello.wasm compiled with Ubuntu 20.04 package
172
254
uses : actions/upload-artifact@v1
173
255
with :
174
- name : linux -hello.wasm
256
+ name : ubuntu2004 -hello.wasm
175
257
path : hello.wasm
0 commit comments