From a18326ed0fb499584398a38c8ea973897666e75d Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 15:40:35 +0100 Subject: [PATCH 1/9] Add `macos` CI stage --- .github/workflows/macos.yml | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 00000000..92874624 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,67 @@ +name: continuous-intergration/macos + +on: + pull_request: + push: + branches: + - master + tags: + - v* + paths-ignore: + - 'README.md' + +jobs: + check: + name: build-contract-template + strategy: + matrix: + platform: + - macos-latest + toolchain: + - nightly + runs-on: ${{ matrix.platform }} + env: + RUST_BACKTRACE: full + steps: + + - uses: engineerd/configurator@v0.0.6 + with: + name: "wasm-opt.exe" + url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" + pathInArchive: "binaryen-/bin/wasm-opt.exe" + + - name: Checkout sources & submodules + uses: actions/checkout@master + with: + fetch-depth: 1 + submodules: recursive + + - name: Install toolchain + id: toolchain + uses: actions-rs/toolchain@master + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + components: rust-src + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@v1.2.0 + + - name: Build contract template on ${{ matrix.platform }}-${{ matrix.toolchain }} + run: | + wasm-opt --version + cargo -vV + cargo run -- contract --version + cargo run -- contract new foobar + echo "[workspace]" >> foobar/Cargo.toml + cargo run -- contract build --manifest-path=foobar/Cargo.toml + cargo run -- contract check --manifest-path=foobar/Cargo.toml + cargo run -- contract test --manifest-path=foobar/Cargo.toml + + - name: Run tests on {{ matrix.platform }}-${{ matrix.toolchain }} + # The tests take a long time in the GitHub Actions runner (~30 mins), + # hence we run them only on `master`. + if: github.ref == 'refs/heads/master' + run: | + cargo test --verbose --workspace --all-features -- GitLab From 0ca586f4bcd3503fad2003ce7994cab1279c94a5 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 15:41:10 +0100 Subject: [PATCH 2/9] Update to latest `binaryen` --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3e16d3ca..3095ba57 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -27,8 +27,8 @@ jobs: - uses: engineerd/configurator@v0.0.6 with: name: "wasm-opt.exe" - url: "https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-windows.tar.gz" - pathInArchive: "binaryen-version_101/bin/wasm-opt.exe" + url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-windows.tar.gz" + pathInArchive: "binaryen-/bin/wasm-opt.exe" - name: Checkout sources & submodules uses: actions/checkout@master -- GitLab From ec64a39ece484d08c6713ccadcec3373d550ff5f Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 15:41:24 +0100 Subject: [PATCH 3/9] Format yml --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3095ba57..efe46336 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -45,8 +45,8 @@ jobs: components: rust-src override: true - - name: Rust Cache - uses: Swatinem/rust-cache@v1.2.0 + - name: Rust Cache + uses: Swatinem/rust-cache@v1.2.0 - name: Build contract template on ${{ matrix.platform }}-${{ matrix.toolchain }} run: | -- GitLab From 8d6dcd55a3e92201cd9ac5b222cfe7851d8c5f6a Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 15:42:30 +0100 Subject: [PATCH 4/9] Ignore `.gitlab-ci.yml` --- .github/workflows/macos.yml | 1 + .github/workflows/windows.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 92874624..e0b2b720 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -9,6 +9,7 @@ on: - v* paths-ignore: - 'README.md' + - '.gitlab-ci.yml' jobs: check: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index efe46336..7b137639 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -9,6 +9,7 @@ on: - v* paths-ignore: - 'README.md' + - '.gitlab-ci.yml' jobs: check: -- GitLab From 5b763bae78af87d5c9485f6a7848617aeafdb6dd Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 15:47:13 +0100 Subject: [PATCH 5/9] Strip `.exe` --- .github/workflows/macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e0b2b720..5da0b4e4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -27,9 +27,9 @@ jobs: - uses: engineerd/configurator@v0.0.6 with: - name: "wasm-opt.exe" + name: "wasm-opt" url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" - pathInArchive: "binaryen-/bin/wasm-opt.exe" + pathInArchive: "binaryen-/bin/wasm-opt" - name: Checkout sources & submodules uses: actions/checkout@master -- GitLab From 31e5faf060e159705658b79ba199ad614fff9b0d Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 15:58:35 +0100 Subject: [PATCH 6/9] Install dylib file --- .github/workflows/macos.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5da0b4e4..d973f7c8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -31,6 +31,12 @@ jobs: url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" pathInArchive: "binaryen-/bin/wasm-opt" + - uses: engineerd/configurator@v0.0.6 + with: + name: "libbinaryen.dylib" + url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" + pathInArchive: "binaryen-/lib/libbinaryen.dylib" + - name: Checkout sources & submodules uses: actions/checkout@master with: -- GitLab From e5c093e09b52639c513f8f80f75ef21a5bb94b95 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 16:13:05 +0100 Subject: [PATCH 7/9] Fix path --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d973f7c8..c50cf514 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -33,7 +33,7 @@ jobs: - uses: engineerd/configurator@v0.0.6 with: - name: "libbinaryen.dylib" + name: "lib/libbinaryen.dylib" url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" pathInArchive: "binaryen-/lib/libbinaryen.dylib" -- GitLab From 8832efea12c3d32f0e77435328d3a1e91e89a5bb Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 16:20:58 +0100 Subject: [PATCH 8/9] Install `wasm-opt` via `npm` --- .github/workflows/macos.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index c50cf514..62c97326 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -25,17 +25,11 @@ jobs: RUST_BACKTRACE: full steps: - - uses: engineerd/configurator@v0.0.6 + - uses: actions/setup-node@v2 with: - name: "wasm-opt" - url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" - pathInArchive: "binaryen-/bin/wasm-opt" + cache: 'npm' - - uses: engineerd/configurator@v0.0.6 - with: - name: "lib/libbinaryen.dylib" - url: "https://github.com/WebAssembly/binaryen/releases/download/version_103/binaryen-version_103-x86_64-macos.tar.gz" - pathInArchive: "binaryen-/lib/libbinaryen.dylib" + - run: npm install wasm-opt -g - name: Checkout sources & submodules uses: actions/checkout@master -- GitLab From 1f54a64d04a7f9f98fa8acb4b061fa53aaf7be55 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Mon, 6 Dec 2021 16:24:07 +0100 Subject: [PATCH 9/9] Remove cache, since it uses lockfiles --- .github/workflows/macos.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 62c97326..424e34f4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -25,18 +25,15 @@ jobs: RUST_BACKTRACE: full steps: - - uses: actions/setup-node@v2 - with: - cache: 'npm' - - - run: npm install wasm-opt -g - - name: Checkout sources & submodules uses: actions/checkout@master with: fetch-depth: 1 submodules: recursive + - uses: actions/setup-node@v2 + - run: npm install wasm-opt -g + - name: Install toolchain id: toolchain uses: actions-rs/toolchain@master -- GitLab