Skip to content

Commit

Permalink
ci: use rustup on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs committed Sep 18, 2024
1 parent 609ddb9 commit 5ff237e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
- aarch64-unknown-linux-musl
- aarch64-linux-android
- riscv64gc-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-musl
# TODO: figure out what's different in Mac libraries built this way
# 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
Expand All @@ -44,10 +44,14 @@ jobs:
with:
package: west-${{ matrix.target }}

build-ffi-darwin:
build-ffi-rustup:
strategy:
matrix:
config:
- os: windows-latest
lib: x86_64-windows
target: x86_64-pc-windows-msvc

- os: macos-13
lib: x86_64-darwin
target: x86_64-apple-darwin
Expand All @@ -65,6 +69,9 @@ jobs:
- run: cargo build -p west-sys --release
- run: mkdir -p artifact/lib
- run: mv target/release/libwest_sys.a artifact/lib/libwest_sys.a
if: matrix.config.os != 'windows-latest'
- run: mv target/release/west_sys.lib artifact/lib/west_sys.lib
if: matrix.config.os == 'windows-latest'
- uses: actions/upload-artifact@v4
with:
name: west-${{ matrix.config.target }}
Expand Down Expand Up @@ -96,7 +103,7 @@ jobs:

- os: windows-latest
lib: x86_64-windows
target: x86_64-pc-windows-gnu
target: x86_64-pc-windows-msvc

- os: macos-13
lib: x86_64-darwin
Expand All @@ -109,7 +116,7 @@ jobs:
name: test-release (${{ matrix.config.os }})
needs:
- build-ffi
- build-ffi-darwin
- build-ffi-rustup
- build-wasm
runs-on: ${{ matrix.config.os }}
steps:
Expand All @@ -122,6 +129,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'
Expand Down Expand Up @@ -158,6 +168,12 @@ jobs:
- run: cargo binstall -y [email protected]
- run: cargo test --workspace --all-targets
- run: go generate -tags=dev ./...
if: matrix.os != 'windows-latest'
- run: |
cargo build -p west-sys
cargo build -p west-passthrough --target wasm32-unknown-unknown
wasm-tools component new target/wasm32-unknown-unknown/debug/west_passthrough.wasm -o lib/passthrough.wasm
if: matrix.os == 'windows-latest'
- run: go test -tags=dev ./...
env:
GOGC: 1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/target
*.wasm
*.a
*.lib
west_bindings_test.go
/go/internal/tests/*/bindings/*
3 changes: 1 addition & 2 deletions build_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@

package west

// #cgo LDFLAGS: -L${SRCDIR}/target/debug -lwest_sys
// #cgo linux LDFLAGS: -lm
// #cgo LDFLAGS: -L${SRCDIR}/target/debug -lwest_sys
import "C"

0 comments on commit 5ff237e

Please sign in to comment.