1111 - swiftwasm-release/5.3
1212
1313jobs :
14- linux_build :
14+ ubuntu1804_build :
1515 timeout-minutes : 0
1616 runs-on : ubuntu-18.04
1717
@@ -39,17 +39,63 @@ jobs:
3939 - uses : actions/cache@v1
4040 with :
4141 path : ../build-cache
42- key : ${{ runner.os }} -sccache-v10-${{ steps.cache_timestamp.outputs.timestamp }}
42+ key : ubuntu-18.04 -sccache-v10-${{ steps.cache_timestamp.outputs.timestamp }}
4343 restore-keys : |
44- ${{ runner.os }} -sccache-v10-
45- - name : Build Linux installable archive
44+ ubuntu-18.04 -sccache-v10-
45+ - name : Build Ubuntu 18.04 installable archive
4646 run : |
4747 ./utils/webassembly/ci.sh
48- - name : Upload Linux installable archive
48+ - name : Upload Ubuntu 18.04 installable archive
4949 uses : actions/upload-artifact@v1
5050 with :
51- name : linux-installable
52- path : ../swift-wasm-DEVELOPMENT-SNAPSHOT-linux.tar.gz
51+ name : ubuntu18.04-installable
52+ path : ../swift-wasm-DEVELOPMENT-SNAPSHOT-ubuntu18.04.tar.gz
53+ # - name: Pack test results
54+ # run: tar cJf swift-test-results.tar.gz ../build/*/swift-linux-x86_64/swift-test-results
55+ # - name: Upload test results
56+ # uses: actions/upload-artifact@v1
57+ # with:
58+ # name: linux-test-results
59+ # path: ./swift-test-results.tar.gz
60+
61+ ubuntu2004_build :
62+ timeout-minutes : 0
63+ runs-on : ubuntu-20.04
64+
65+ steps :
66+ - name : Free disk space
67+ run : |
68+ df -h
69+ sudo swapoff -a
70+ sudo rm -f /swapfile
71+ sudo rm -rf /opt/hostedtoolcache
72+ sudo rm -rf /usr/share/dotnet
73+ sudo apt clean
74+ docker rmi $(docker image ls -aq)
75+ df -h
76+ - uses : actions/checkout@v1
77+ with :
78+ path : swift
79+ - name : Prepare sccache timestamp
80+ id : cache_timestamp
81+ shell : cmake -P {0}
82+ run : |
83+ string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
84+ message("::set-output name=timestamp::${current_date}")
85+ - uses : actions/cache@v1
86+ with :
87+ path : ../build-cache
88+ key : ubuntu-20.04-sccache-v10-${{ steps.cache_timestamp.outputs.timestamp }}
89+ restore-keys : |
90+ ubuntu-20.04-sccache-v10-
91+ - name : Build Ubuntu 20.04 installable archive
92+ run : |
93+ ./utils/webassembly/ci.sh
94+ - name : Upload Ubuntu 20.04 installable archive
95+ uses : actions/upload-artifact@v1
96+ with :
97+ name : ubuntu20.04-installable
98+ path : ../swift-wasm-DEVELOPMENT-SNAPSHOT-ubuntu20.04.tar.gz
5399# - name: Pack test results
54100# run: tar cJf swift-test-results.tar.gz ../build/*/swift-linux-x86_64/swift-test-results
55101# - name: Upload test results
94140 with :
95141 name : macos-test-results
96142 path : ./swift-test-results.tar.gz
143+
97144 macos_smoke_test :
98145 name : Run smoke tests on macOS
99146 runs-on : macos-latest
@@ -129,15 +176,16 @@ jobs:
129176 with :
130177 name : macos-hello.wasm
131178 path : hello.wasm
132- linux_smoke_test :
133- name : Run smoke tests on Linux
179+
180+ ubuntu1804_smoke_test :
181+ name : Run smoke tests on Ubuntu 18.04
134182 runs-on : ubuntu-18.04
135- needs : linux_build
183+ needs : ubuntu1804_build
136184 steps :
137- - name : Download installable Linux archive
185+ - name : Download installable Ubuntu 18.04 archive
138186 uses : actions/download-artifact@v1
139187 with :
140- name : linux -installable
188+ name : ubuntu18.04 -installable
141189 - name : Build hello.wasm
142190 shell : bash
143191 run : |
@@ -159,8 +207,44 @@ jobs:
159207 cd test
160208 $TOOLCHAIN_PATH/usr/bin/swift package init
161209 $TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
162- - name : Upload hello.wasm compiled with Linux package
210+ - name : Upload hello.wasm compiled with Ubuntu 18.04 package
163211 uses : actions/upload-artifact@v1
164212 with :
165- name : linux -hello.wasm
213+ name : ubuntu18.04 -hello.wasm
166214 path : hello.wasm
215+
216+ ubuntu2004_smoke_test :
217+ name : Run smoke tests on Ubuntu 20.04
218+ runs-on : ubuntu-20.04
219+ needs : ubuntu2004_build
220+ steps :
221+ - name : Download installable Ubuntu 20.04 archive
222+ uses : actions/download-artifact@v1
223+ with :
224+ name : ubuntu20.04-installable
225+ - name : Build hello.wasm
226+ shell : bash
227+ run : |
228+ set -x
229+ tar xf $(find . -name "swift-wasm-*.tar.gz" -type f)
230+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
231+ echo 'print("Hello, world!")' > hello.swift
232+ $TOOLCHAIN_PATH/usr/bin/swiftc \
233+ -target wasm32-unknown-wasi \
234+ -sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
235+ hello.swift -o hello.wasm && \
236+ echo "Successfully linked hello.wasm"
237+ - name : Test SwiftPM
238+ shell : bash
239+ run : |
240+ set -x
241+ TOOLCHAIN_PATH=$(find "$PWD" -name "swift-wasm-*" -type d)
242+ mkdir test
243+ cd test
244+ $TOOLCHAIN_PATH/usr/bin/swift package init
245+ $TOOLCHAIN_PATH/usr/bin/swift build --triple wasm32-unknown-wasi
246+ - name : Upload hello.wasm compiled with Ubuntu 20.04 package
247+ uses : actions/upload-artifact@v1
248+ with :
249+ name : ubuntu2004-hello.wasm
250+ path : hello.wasm
0 commit comments