Skip to content

Commit

Permalink
Run packaging scripts and smoke test on CI (#15)
Browse files Browse the repository at this point in the history
Any changes in this repository should be tested with the packaging script and a basic smoke test that compiles `hello.swift` on CI.

In the future packaging and linking scripts should be moved to this repository, `swiftwasm-sdk` and `swiftwasm-package-sdk` projects probably would be archived when that happens. For now we're pulling the scripts from `swiftwasm-package-sdk` as it is.

* Run packaging scripts and smoke test on CI

* Make prepare-package.sh executable

* Make SymbolLookup.swift compilable for wasm

* Use GitHub Actions upload/download steps

* Remove packaging steps from ci-*.sh

* Move prepare-package.sh to main.yml to avoid clone

* Refine formatting in .github/workflows/main.yml
  • Loading branch information
MaxDesiatov authored and kateinoigakukun committed Dec 14, 2019
1 parent 6c240af commit 3d425b0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,56 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Run a multi-line script
- name: Build Linux installable archive
run: ./ci-linux.sh
- name: Upload Linux installable archive
uses: actions/upload-artifact@v1
with:
name: linux-installable
path: ../swiftwasm-linux.tar.gz

macos_build:
timeout-minutes: 0
runs-on: macOS-10.14

steps:
- uses: actions/checkout@v1
- name: Run a multi-line script
- name: Build macOS installable archive
run: ./ci-mac.sh
- name: Upload macOS installable archive
uses: actions/upload-artifact@v1
with:
name: macos-installable
path: ../swiftwasm-mac.tar.gz

package:
name: Build SwiftWasm packages
needs:
- linux_build
- macos_build
runs-on: ubuntu-18.04
steps:
- name: Download installable Linux archive
uses: actions/download-artifact@v1
with:
name: linux-installable
- name: Download installable macOS archive
uses: actions/download-artifact@v1
with:
name: macos-installable
- name: Build the packages
shell: bash
run: |
git clone https://github.com/swiftwasm/swiftwasm-package-sdk.git
cd swiftwasm-package-sdk
./download-prebuilts.sh
cp ../linux-installable/swiftwasm-linux.tar.gz prebuilt/swiftwasm.tar.gz
cp ../macos-installable/swiftwasm-mac.tar.gz prebuilt/swiftwasm-mac.tar.gz
./build-packages.sh
cd output
tar xf swiftwasm-sdk-linux.tar.xz
cd swiftwasm-sdk
./swiftwasm example/hello.swift hello.wasm
2 changes: 1 addition & 1 deletion build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export sourcedir=$PWD/..
--install-destdir="$sourcedir/install" \
--install-prefix="/opt/swiftwasm-sdk" \
--install-swift \
--installable-package="$sourcedir/swiftwasm.tar.gz" \
--installable-package="$sourcedir/swiftwasm-linux.tar.gz" \
--llvm-targets-to-build "X86;WebAssembly" \
--stdlib-deployment-targets "wasm-wasm32" \
--wasm-icu-data "todo-icu-data" \
Expand Down

0 comments on commit 3d425b0

Please sign in to comment.