From 7b563ccc3dc4c79b02541e08d8490a88fa6661f4 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 28 Oct 2019 10:47:08 +0000 Subject: [PATCH 1/5] Add simple GitHub Actions config for macOS --- .github/workflows/main.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000000..62acd4e73caa0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,37 @@ +name: CI + +on: + pull_request: + branches: + - swiftwasm + +jobs: + macos_build: + timeout-minutes: 0 + runs-on: macOS-10.14 + + steps: + - uses: actions/checkout@v1 + - name: Run a multi-line script + run: | + ./utils/build-script --debug --wasm \ + --skip-build-benchmarks \ + --extra-cmake-options=" \ + -DSWIFT_PRIMARY_VARIANT_SDK:STRING=WASM \ + -DSWIFT_PRIMARY_VARIANT_ARCH:STRING=wasm32 \ + -DSWIFT_OSX_x86_64_ICU_STATICLIB=TRUE \ + -DSWIFT_BUILD_SOURCEKIT=FALSE \ + -DSWIFT_ENABLE_SOURCEKIT_TESTS=FALSE \ + " \ + --stdlib-deployment-targets "wasm-wasm32" \ + --build-stdlib-deployment-targets "wasm-wasm32" \ + --llvm-targets-to-build "X86;WebAssembly" \ + --build-swift-dynamic-sdk-overlay false \ + --build-swift-static-sdk-overlay false \ + --wasm-wasi-sdk "$sourcedir/wasi-sdk" \ + --wasm-icu-uc "$sourcedir/icu_out/lib/libicuuc.a" \ + --wasm-icu-uc-include "$sourcedir/icu_out/include" \ + --wasm-icu-i18n "$sourcedir/icu_out/lib/libicui18n.a" \ + --wasm-icu-i18n-include "$sourcedir/icu_out/include" \ + --wasm-icu-data "todo-icu-data" \ + --build-swift-static-stdlib From 544c068f336ef8b4cbaf01cd132bf18629ae8278 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 28 Oct 2019 10:54:44 +0000 Subject: [PATCH 2/5] Add brew install to the macOS GH action --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62acd4e73caa0..ef8ffd8a207e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,7 @@ jobs: - uses: actions/checkout@v1 - name: Run a multi-line script run: | + brew install cmake ninja ./utils/build-script --debug --wasm \ --skip-build-benchmarks \ --extra-cmake-options=" \ From 1de065645b743241eb331849b74f24e434a38c9c Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 28 Oct 2019 10:57:54 +0000 Subject: [PATCH 3/5] Add update-checkout call to macOS GH action --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef8ffd8a207e9..a9523f2d73327 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,7 @@ jobs: - name: Run a multi-line script run: | brew install cmake ninja + ./utils/update-checkout --clone --scheme wasm ./utils/build-script --debug --wasm \ --skip-build-benchmarks \ --extra-cmake-options=" \ From 3998824a15874d00c70ec94f7a7414ed96077e89 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 28 Oct 2019 12:55:38 +0000 Subject: [PATCH 4/5] Export sourcedir shell variable in macOS GH action --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9523f2d73327..b34833cab8672 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,7 @@ jobs: run: | brew install cmake ninja ./utils/update-checkout --clone --scheme wasm + export sourcedir=$PWD/.. ./utils/build-script --debug --wasm \ --skip-build-benchmarks \ --extra-cmake-options=" \ From 19ca6b1a7ad640d8c0e26fe346704e77e3b4ed0b Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 30 Oct 2019 15:28:16 +0000 Subject: [PATCH 5/5] Add wasi-sdk and icu install steps to the script --- .github/workflows/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b34833cab8672..91dd26bcda915 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,17 @@ jobs: brew install cmake ninja ./utils/update-checkout --clone --scheme wasm export sourcedir=$PWD/.. + cd $sourcedir + wget -O wasi-sdk.tar.gz https://github.com/swiftwasm/wasi-sdk/releases/download/20190421.6/wasi-sdk-3.19gefb17cb478f9.m-linux.tar.gz + tar xfz wasi-sdk.tar.gz + mv wasi-sdk-3.19gefb17cb478f9+m/opt/wasi-sdk ./wasi-sdk + # Link sysroot/usr/include to sysroot/include because Darwin sysroot doesn't + # find header files in sysroot/include but sysroot/usr/include + mkdir wasi-sdk/share/sysroot/usr/ + ln -s ../include wasi-sdk/share/sysroot/usr/include + wget -O icu.tar.xz "https://github.com/swiftwasm/icu4c-wasi/releases/download/20190421.3/icu4c-wasi.tar.xz" + tar xf icu.tar.xz + cd swift ./utils/build-script --debug --wasm \ --skip-build-benchmarks \ --extra-cmake-options=" \