From 70f9b8d4c776ae4db0af4c873c4e48eca81afe28 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 18 Sep 2024 17:41:48 +0200 Subject: [PATCH] ci: target gnu on windows Signed-off-by: Roman Volosatovs --- .github/workflows/west.yml | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/.github/workflows/west.yml b/.github/workflows/west.yml index 2f99a34..9626c90 100644 --- a/.github/workflows/west.yml +++ b/.github/workflows/west.yml @@ -24,14 +24,14 @@ jobs: strategy: matrix: target: - - aarch64-unknown-linux-musl - aarch64-linux-android + - aarch64-unknown-linux-musl - riscv64gc-unknown-linux-gnu + - x86_64-pc-windows-gnu - x86_64-unknown-linux-musl # TODO: figure out what's different in Mac/Windows libraries built this way #- aarch64-apple-darwin #- x86_64-apple-darwin - #- x86_64-pc-windows-gnu name: west-${{ matrix.target }} runs-on: ubuntu-latest @@ -48,9 +48,6 @@ jobs: strategy: matrix: config: - - os: windows-latest - target: x86_64-pc-windows-msvc - - os: macos-13 target: x86_64-apple-darwin @@ -63,12 +60,9 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - run: rustup show - uses: Swatinem/rust-cache@v2.7.3 - - run: cargo build -p west-sys --release --target ${{ matrix.config.target }} + - run: SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build -p west-sys --release --target ${{ matrix.config.target }} - run: mkdir -p artifact/lib - - run: mv target/release/${{ matrix.config.target }}/libwest_sys.a artifact/lib/libwest_sys.a - if: matrix.config.os != 'windows-latest' - - run: mv target/release/${{ matrix.config.target }}/west_sys.lib artifact/lib/west_sys.lib - if: matrix.config.os == 'windows-latest' + - run: mv target/${{ matrix.config.target }}/release/libwest_sys.a artifact/lib/libwest_sys.a - uses: actions/upload-artifact@v4 with: name: west-${{ matrix.config.target }} @@ -100,7 +94,7 @@ jobs: - os: windows-latest lib: x86_64-windows - target: x86_64-pc-windows-msvc + target: x86_64-pc-windows-gnu - os: macos-13 lib: x86_64-darwin @@ -126,12 +120,9 @@ jobs: with: name: west-${{ matrix.config.target }} - run: mv lib/libwest_sys.a "lib/${{ matrix.config.lib }}/libwest.a" - if: matrix.config.os != 'windows-latest' - - run: mv lib/west_sys.lib "lib/${{ matrix.config.lib }}/west.lib" - if: matrix.config.os == 'windows-latest' - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: go.mod - run: rustup show - uses: Swatinem/rust-cache@v2.7.3 - uses: cargo-bins/cargo-binstall@v1.10.5 @@ -158,21 +149,15 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: go.mod - run: rustup show - uses: Swatinem/rust-cache@v2.7.3 - uses: cargo-bins/cargo-binstall@v1.10.5 - run: cargo binstall -y wasm-tools@1.217 - run: cargo test --workspace --all-targets - run: go generate -tags=dev ./... - if: matrix.os != 'windows-latest' - - run: | - cargo build -p west-sys --target x86_64-pc-windows-msvc - cargo build -p west-passthrough --target wasm32-unknown-unknown - go generate -tags=dev ./examples/go/... - go generate -tags=dev ./tests/go/... - wasm-tools component new target/wasm32-unknown-unknown/debug/west_passthrough.wasm -o lib/passthrough.wasm - if: matrix.os == 'windows-latest' + env: + RUSTFLAGS: -C target-feature=+crt-static - run: go test -tags=dev ./... env: GOGC: 1 @@ -186,7 +171,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions/setup-go@v5 with: - go-version-file: 'go.mod' + go-version-file: go.mod - run: gofmt -w -s **/*.go - run: git diff --exit-code