Skip to content

Commit 6aab959

Browse files
committed
initial testing workflow
1 parent eebf3bd commit 6aab959

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

.github/workflows/test-java-bindings-new.yml

+45-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Cross-platform Build
1+
name: Cross-platform Build and Test
22

33
on:
44
push:
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- uses: actions/checkout@v3
28-
28+
2929
- name: Install Rust
3030
uses: actions-rs/toolchain@v1
3131
with:
@@ -52,11 +52,52 @@ jobs:
5252
run: sudo apt-get install gcc-mingw-w64-x86-64 -y
5353

5454
- name: Build with cargo-zigbuild
55-
# if: ${{ !endsWith(matrix.target, 'windows-gnu') && !endsWith(matrix.target, 'windows-msvc') }}
5655
run: cargo zigbuild --target ${{ matrix.target }} --release
5756

5857
- name: Upload artifacts
5958
uses: actions/upload-artifact@v3
6059
with:
6160
name: ${{ matrix.target }}
62-
path: target/${{ matrix.target }}/release/*
61+
path: target/${{ matrix.target }}/release/*
62+
63+
test:
64+
name: Test on ${{ matrix.os }}
65+
needs: build
66+
strategy:
67+
matrix:
68+
include:
69+
- os: ubuntu-latest
70+
target: x86_64-unknown-linux-gnu
71+
- os: linux-arm64
72+
target: aarch64-unknown-linux-gnu
73+
- os: macos-latest
74+
target: x86_64-apple-darwin
75+
- os: macos-latest
76+
target: aarch64-apple-darwin
77+
- os: windows-latest
78+
target: x86_64-pc-windows-gnu
79+
80+
runs-on: ${{ matrix.os }}
81+
82+
steps:
83+
- uses: actions/checkout@v3
84+
85+
- name: Install Rust
86+
uses: actions-rs/toolchain@v1
87+
with:
88+
toolchain: stable
89+
target: ${{ matrix.target }}
90+
override: true
91+
92+
- name: Download artifacts
93+
uses: actions/download-artifact@v3
94+
with:
95+
name: ${{ matrix.target }}
96+
path: target/${{ matrix.target }}/release
97+
98+
- name: Make binaries executable
99+
if: runner.os != 'Windows'
100+
run: chmod +x target/${{ matrix.target }}/release/*
101+
102+
- name: Run tests
103+
run: cargo test --target ${{ matrix.target }}

0 commit comments

Comments
 (0)