From 3d425b0cedd3b4930bee488d3bee880ea6e3d050 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Sat, 16 Nov 2019 09:52:08 +0000 Subject: [PATCH] Run packaging scripts and smoke test on CI (#15) 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 --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++-- build-linux.sh | 2 +- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ca46da5c1f08..6ece20e7139ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,13 @@ 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 @@ -24,5 +29,42 @@ jobs: 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 diff --git a/build-linux.sh b/build-linux.sh index 285a5b05a3c9c..30285c85a2dc9 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -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" \