Skip to content

Commit b0ded07

Browse files
authored
Upload SwiftWasm artifacts for later inspection (#17)
It would be convenient if packaged SDK and result of the smoke test were uploaded as artifacts of the CI run and become downloadable for later use. * Add more logging to the smoke test * Add a newline to main.yml * Upload packages and hello.wasm as CI artifacts * Normalize filenames for swiftwasm-package-sdk * Add macos_smoke_test job
1 parent b6040e8 commit b0ded07

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

.github/workflows/main.yml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/upload-artifact@v1
3636
with:
3737
name: macos-installable
38-
path: ../swiftwasm-mac.tar.gz
38+
path: ../swiftwasm-macos.tar.gz
3939

4040
package:
4141
name: Build SwiftWasm packages
@@ -59,12 +59,56 @@ jobs:
5959
cd swiftwasm-package-sdk
6060
./download-prebuilts.sh
6161
62-
cp ../linux-installable/swiftwasm-linux.tar.gz prebuilt/swiftwasm.tar.gz
63-
cp ../macos-installable/swiftwasm-mac.tar.gz prebuilt/swiftwasm-mac.tar.gz
62+
cp ../linux-installable/swiftwasm-linux.tar.gz \
63+
../macos-installable/swiftwasm-macos.tar.gz \
64+
prebuilt
6465
./build-packages.sh
6566
6667
cd output
67-
tar xf swiftwasm-sdk-linux.tar.xz
68+
tar xf swiftwasm-sdk-linux.tar.xz && echo "Successfully unpacked Linux SDK"
6869
6970
cd swiftwasm-sdk
70-
./swiftwasm example/hello.swift hello.wasm
71+
./swiftwasm example/hello.swift hello.wasm && echo "Successfully linked hello.wasm"
72+
73+
- name: Upload macOS package
74+
uses: actions/upload-artifact@v1
75+
with:
76+
name: macos-package
77+
path: swiftwasm-package-sdk/output/swiftwasm-sdk-macos.tar.xz
78+
79+
- name: Upload Linux package
80+
uses: actions/upload-artifact@v1
81+
with:
82+
name: linux-package
83+
path: swiftwasm-package-sdk/output/swiftwasm-sdk-linux.tar.xz
84+
85+
- name: Upload hello.wasm compiled with Linux package
86+
uses: actions/upload-artifact@v1
87+
with:
88+
name: linux-hello.wasm
89+
path: swiftwasm-package-sdk/output/swiftwasm-sdk/hello.wasm
90+
91+
macos_smoke_test:
92+
name: Compile hello.swift on macOS
93+
runs-on: macOS-10.14
94+
needs: package
95+
steps:
96+
- name: Download SwiftWasm macOS package
97+
uses: actions/download-artifact@v1
98+
with:
99+
name: macos-package
100+
101+
- name: Build hello.wasm
102+
shell: bash
103+
run: |
104+
cd macos-package
105+
tar xf swiftwasm-sdk-macos.tar.xz && echo "Successfully unpacked macOS SDK"
106+
107+
cd swiftwasm-sdk
108+
./swiftwasm example/hello.swift hello.wasm && echo "Successfully linked hello.wasm"
109+
110+
- name: Upload hello.wasm compiled with macOS package
111+
uses: actions/upload-artifact@v1
112+
with:
113+
name: macos-hello.wasm
114+
path: macos-package/swiftwasm-sdk/hello.wasm

build-mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ export sourcedir=$PWD/..
2828
--install-swift \
2929
--install-prefix="/opt/swiftwasm-sdk" \
3030
--install-destdir="$sourcedir/install" \
31-
--installable-package="$sourcedir/swiftwasm-mac.tar.gz"
31+
--installable-package="$sourcedir/swiftwasm-macos.tar.gz"

0 commit comments

Comments
 (0)