From adb0e6958ef6cac86eabc2b679b49206c3a37708 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 31 Oct 2023 17:13:50 -0700 Subject: [PATCH] Only enable wasm feature on CI for supported architectures --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8087251d..b3571796 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,7 @@ jobs: - { platform: linux-armhf , target: arm-unknown-linux-gnueabihf , os: ubuntu-latest , use-cross: true } - { platform: linux-armv5te , target: armv5te-unknown-linux-gnueabi , os: ubuntu-latest , use-cross: true } - { platform: linux-armv7l , target: armv7-unknown-linux-gnueabihf , os: ubuntu-latest , use-cross: true } - - { platform: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 } #2272 + - { platform: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 , enable-wasm: true } #2272 - { platform: linux-x86 , target: i686-unknown-linux-gnu , os: ubuntu-latest , use-cross: true } - { platform: linux-i586 , target: i586-unknown-linux-gnu , os: ubuntu-latest , use-cross: true } - { platform: linux-mips , target: mips-unknown-linux-gnu , os: ubuntu-latest , use-cross: true } @@ -82,10 +82,10 @@ jobs: - { platform: linux-sparc64 , target: sparc64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true } - { platform: linux-thumbv7neon , target: thumbv7neon-unknown-linux-gnueabihf , os: ubuntu-latest , use-cross: true } - { platform: windows-arm64 , target: aarch64-pc-windows-msvc , os: windows-latest } - - { platform: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest } + - { platform: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest , enable-wasm: true } - { platform: windows-x86 , target: i686-pc-windows-msvc , os: windows-latest } - - { platform: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest } - - { platform: macos-x64 , target: x86_64-apple-darwin , os: macos-latest } + - { platform: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest , enable-wasm: true } + - { platform: macos-x64 , target: x86_64-apple-darwin , os: macos-latest , enable-wasm: true } # Cross compilers for C library - { platform: linux-arm64 , cc: aarch64-linux-gnu-gcc , ar: aarch64-linux-gnu-ar } @@ -184,6 +184,7 @@ jobs: CC: ${{ matrix.cc }} AR: ${{ matrix.ar }} IS_WINDOWS: ${{ contains(matrix.os, 'windows') }} + ENABLE_WASM: ${{ matrix.enable-wasm }} run: | PATH="$PWD/.github/scripts:$PATH" echo "$PWD/.github/scripts" >> $GITHUB_PATH @@ -200,6 +201,10 @@ jobs: [ "$IS_WINDOWS" = "false" ] && echo "CFLAGS=-Werror" >> $GITHUB_ENV + if [ "$ENABLE_WASM" == "true" ]; then + echo "CLI_FEATURES=wasm" >> $GITHUB_ENV + fi + if [ "$USE_CROSS" == "true" ]; then echo "BUILD_CMD=cross" >> $GITHUB_ENV runner=$(BUILD_CMD=cross cross.sh bash -c "env | sed -nr '/^CARGO_TARGET_.*_RUNNER=/s///p'") @@ -215,7 +220,7 @@ jobs: run: script/build-wasm - name: Build CLI - run: $BUILD_CMD build --release --target=${{ matrix.target }} + run: $BUILD_CMD build --release --target=${{ matrix.target }} --features=${CLI_FEATURES} - name: Info about CLI if: ${{ startsWith(matrix.platform, 'linux') }}