-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Roman Volosatovs <[email protected]>
- Loading branch information
1 parent
afc7622
commit 1098147
Showing
1 changed file
with
105 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,44 +20,123 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
build-ffi: | ||
strategy: | ||
matrix: | ||
target: | ||
- aarch64-unknown-linux-musl | ||
- aarch64-apple-darwin | ||
- aarch64-linux-android | ||
- riscv64gc-unknown-linux-gnu | ||
- x86_64-apple-darwin | ||
- x86_64-pc-windows-gnu | ||
- x86_64-unknown-linux-musl | ||
|
||
name: west-${{ matrix.target }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- uses: ./.github/actions/install-nix | ||
with: | ||
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- uses: ./.github/actions/build-nix | ||
with: | ||
package: west-${{ matrix.target }} | ||
|
||
build-wasm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- uses: ./.github/actions/install-nix | ||
with: | ||
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- run: nix profile install --inputs-from . '.#rust' 'nixpkgs#wasm-tools' | ||
- run: cargo build -p west-passthrough --target wasm32-unknown-unknown --release | ||
- run: wasm-tools component new target/wasm32-unknown-unknown/release/west_passthrough.wasm -o lib/passthrough.wasm | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: passthrough | ||
path: lib/passthrough.wasm | ||
|
||
test-release: | ||
strategy: | ||
matrix: | ||
config: | ||
- os: ubuntu-latest | ||
lib: x86_64-linux | ||
target: x86_64-unknown-linux-musl | ||
- os: ubuntu-latest | ||
lib: x86_64-linux | ||
target: x86_64-unknown-linux-musl | ||
|
||
- os: windows-latest | ||
lib: x86_64-windows | ||
target: x86_64-pc-windows-msvc | ||
- os: windows-latest | ||
lib: x86_64-windows | ||
target: x86_64-pc-windows-gnu | ||
|
||
- os: macos-13 | ||
lib: x86_64-darwin | ||
target: x86_64-apple-darwin | ||
- os: macos-13 | ||
lib: x86_64-darwin | ||
target: x86_64-apple-darwin | ||
|
||
- os: macos-14 | ||
lib: aarch64-darwin | ||
target: aarch64-apple-darwin | ||
- os: macos-14 | ||
lib: aarch64-darwin | ||
target: aarch64-apple-darwin | ||
|
||
needs: | ||
- build-ffi | ||
- build-wasm | ||
runs-on: ${{ matrix.config.os }} | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: passthrough | ||
path: lib/passthrough.wasm | ||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
with: | ||
name: west-${{ matrix.config.target }} | ||
path: lib/${{ matrix.config.lib }}/libwest.a | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: rustup show | ||
- uses: cargo-bins/[email protected] | ||
- run: cargo binstall -y [email protected] | ||
- run: go generate ./tests/go/... | ||
- run: go test ./... | ||
continue-on-error: true # TODO: remove | ||
- run: git diff --exit-code | ||
|
||
test-dev: | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-13 | ||
- macos-14 | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- run: rustup show | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'go.mod' | ||
- uses: Swatinem/[email protected] | ||
- uses: cargo-bins/[email protected] | ||
- run: rustup show | ||
- run: cargo test --workspace --all-targets | ||
- run: cargo binstall -y [email protected] | ||
- run: go generate ./... | ||
- run: go test ./... | ||
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
- run: cargo test --workspace --all-targets | ||
- run: go generate -tags=dev ./... | ||
- run: go test -tags=dev ./... | ||
continue-on-error: true # TODO: remove | ||
- run: git diff --exit-code | ||
|
||
gofmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
name: west-${{ matrix.config.target }} | ||
path: lib/${{ matrix.config.lib }}/libwest.a | ||
if-no-files-found: error | ||
go-version-file: 'go.mod' | ||
- run: gofmt -w -s **/*.go | ||
- run: git diff --exit-code | ||
|
||
cargo: | ||
strategy: | ||
|
@@ -169,7 +248,9 @@ jobs: | |
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: | ||
- build | ||
- build-ffi | ||
- build-wasm | ||
- test-release | ||
- cargo | ||
- crates | ||
runs-on: ubuntu-latest | ||
|
@@ -204,13 +285,10 @@ jobs: | |
path: artifacts | ||
|
||
- run: | | ||
mkdir -p ./libwest | ||
for dir in ./artifacts/west-*; do | ||
target=${dir#./artifacts/west-} | ||
for lib_path in $(find ${dir}/lib -type f); do | ||
lib=$(basename ${lib_path}) | ||
mkdir -p ./${lib} | ||
mv ${lib_path} ./${lib}/${lib}-${target}.a | ||
done | ||
mv ${dir}/lib/libwest_sys.a ./libwest/libwest-${target}.a | ||
done | ||
- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 | ||
|