Skip to content

Commit

Permalink
ci: trim down the job count
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs committed Aug 27, 2024
1 parent 1a4afe8 commit f07c9cd
Showing 1 changed file with 29 additions and 7 deletions.
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

0 comments on commit f07c9cd

Please sign in to comment.