Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: trim down the job count #284

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions .github/workflows/wrpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,50 @@ jobs:
test-bin: |
nix profile install --inputs-from . 'nixpkgs#qemu'
qemu-aarch64 ./result/bin/wit-bindgen-wrpc --version
qemu-aarch64 ./result/bin/wrpc-wasmtime-nats --version
test-oci: docker load < ./result
# TODO: Run aarch64 binary within OCI

- target: aarch64-apple-darwin
test-bin: file ./result/bin/wit-bindgen-wrpc
test-bin: |
file ./result/bin/wit-bindgen-wrpc
file ./result/bin/wrpc-wasmtime-nats
test-oci: docker load < ./result

- target: aarch64-linux-android
test-bin: file ./result/bin/wit-bindgen-wrpc
test-bin: |
file ./result/bin/wit-bindgen-wrpc
file ./result/bin/wrpc-wasmtime-nats
test-oci: docker load < ./result

- target: riscv64gc-unknown-linux-gnu-fhs
test-bin: |
nix build -L '.#wrpc-riscv64gc-unknown-linux-gnu'
nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-riscv64 ./result/bin/wit-bindgen-wrpc --version
nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-riscv64 ./result/bin/wrpc-wasmtime-nats --version

- target: x86_64-apple-darwin
test-bin: file ./result/bin/wit-bindgen-wrpc
test-bin: |
file ./result/bin/wit-bindgen-wrpc
file ./result/bin/wrpc-wasmtime-nats
test-oci: docker load < ./result

- target: x86_64-pc-windows-gnu
test-bin: |
nix profile install --inputs-from . 'nixpkgs#wine64'
wine64 ./result/bin/wit-bindgen-wrpc.exe --version
wine64 ./result/bin/wrpc-wasmtime-nats.exe --version
test-oci: docker load < ./result
# TODO: Run win64 binary within OCI

- target: x86_64-unknown-linux-musl
test-bin: ./result/bin/wit-bindgen-wrpc --version
test-bin: |
./result/bin/wit-bindgen-wrpc --version
./result/bin/wrpc-wasmtime-nats --version
test-oci: |
docker load < ./result
docker run --rm wrpc:$(nix eval --raw .#wrpc-x86_64-unknown-linux-musl-oci.imageTag) wit-bindgen-wrpc --version
docker run --rm wrpc:$(nix eval --raw .#wrpc-x86_64-unknown-linux-musl-oci.imageTag) wrpc-wasmtime-nats --version

name: wrpc-${{ matrix.config.target }}
runs-on: ubuntu-latest
Expand All @@ -98,6 +110,7 @@ jobs:
if: ${{ !endsWith(matrix.config.target, 'fhs') }}

build-lipo:
if: ${{ !startsWith(github.ref, 'refs/tags/go/') }}
name: wrpc-universal-darwin
needs: build-bin
runs-on: macos-latest
Expand All @@ -113,36 +126,45 @@ jobs:

- run: chmod +x ./x86_64/bin/*
- run: ./x86_64/bin/wit-bindgen-wrpc --version
- run: ./x86_64/bin/wrpc-wasmtime-nats --version

- run: mkdir -p ./artifact/bin
- run: lipo -create ./aarch64/bin/wit-bindgen-wrpc ./x86_64/bin/wit-bindgen-wrpc -output ./artifact/bin/wit-bindgen-wrpc
- run: lipo -create ./aarch64/bin/wrpc-wasmtime-nats ./x86_64/bin/wrpc-wasmtime-nats -output ./artifact/bin/wrpc-wasmtime-nats

- run: chmod +x ./artifact/bin/wit-bindgen-wrpc
- run: ./artifact/bin/wit-bindgen-wrpc --version
- run: chmod +x ./artifact/bin/wrpc-wasmtime-nats
- run: ./artifact/bin/wrpc-wasmtime-nats --version

- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: wrpc-universal-darwin
path: artifact

test-linux:
if: ${{ !startsWith(github.ref, 'refs/tags/go/') }}
runs-on: ubuntu-latest
needs: build-bin
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: wrpc-x86_64-unknown-linux-musl
- run: chmod +x ./bin/wit-bindgen-wrpc
- run: chmod +x ./bin/wrpc-wasmtime-nats
- run: ./bin/wit-bindgen-wrpc --version
- run: ./bin/wrpc-wasmtime-nats --version

test-windows:
if: ${{ !startsWith(github.ref, 'refs/tags/go/') }}
runs-on: windows-latest
needs: build-bin
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: wrpc-x86_64-pc-windows-gnu
- run: .\bin\wit-bindgen-wrpc.exe --version
- run: .\bin\wrpc-wasmtime-nats.exe --version

cargo:
strategy:
Expand All @@ -167,6 +189,7 @@ jobs:
- run: nix build -L .#checks.x86_64-linux.${{ matrix.check }}

crates:
if: ${{ !startsWith(github.ref, 'refs/tags/go/') }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -260,6 +283,7 @@ jobs:
path: doc

deploy-doc:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build-doc
permissions:
Expand All @@ -268,12 +292,12 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
id: deployment

oci:
if: ${{ !startsWith(github.ref, 'refs/tags/crates/') && !startsWith(github.ref, 'refs/tags/go/') }}
runs-on: ubuntu-latest
permissions:
packages: write
Expand Down Expand Up @@ -370,7 +394,6 @@ jobs:
fi

- name: publish wRPC to crates.io
if: startsWith(github.ref, 'refs/tags/v')
run: |
pkgver=$(cargo pkgid | cut -d '@' -f 2)
if ![ "$pkgver" = "${{ steps.ctx.outputs.version }}" ]; then
Expand Down Expand Up @@ -404,7 +427,6 @@ jobs:
done

- uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
prerelease: true
Expand Down
Loading