Skip to content

Commit 7e822d9

Browse files
authored
Merge pull request #1233 from swiftwasm/maxd/swiftpm-smoke-test
Test SwiftPM included in the distribution on CI Resolves #1089. Resolves #1349.
2 parents d5d7a1c + 31705c3 commit 7e822d9

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

.github/workflows/main.yml

+22-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
name: macos-test-results
8080
path: ./swift-test-results.tar.gz
8181
macos_smoke_test:
82-
name: Compile hello.swift on macOS
82+
name: Run smoke tests on macOS
8383
runs-on: macos-latest
8484
needs: macos_build
8585
steps:
@@ -92,21 +92,29 @@ jobs:
9292
run: |
9393
set -x
9494
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)
9696
echo 'print("Hello, world!")' > hello.swift
9797
$TOOLCHAIN_PATH/usr/bin/swiftc \
9898
-target wasm32-unknown-wasi \
9999
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
100100
hello.swift -o hello.wasm && \
101101
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
103111
- name: Upload hello.wasm compiled with macOS package
104112
uses: actions/upload-artifact@v1
105113
with:
106114
name: macos-hello.wasm
107115
path: hello.wasm
108116
linux_smoke_test:
109-
name: Compile hello.swift on Linux
117+
name: Run smoke tests on Linux
110118
runs-on: ubuntu-18.04
111119
needs: linux_build
112120
steps:
@@ -119,14 +127,22 @@ jobs:
119127
run: |
120128
set -x
121129
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)
123131
echo 'print("Hello, world!")' > hello.swift
124132
$TOOLCHAIN_PATH/usr/bin/swiftc \
125133
-target wasm32-unknown-wasi \
126134
-sdk $TOOLCHAIN_PATH/usr/share/wasi-sysroot \
127135
hello.swift -o hello.wasm && \
128136
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
130146
- name: Upload hello.wasm compiled with Linux package
131147
uses: actions/upload-artifact@v1
132148
with:

0 commit comments

Comments
 (0)