Skip to content

Commit 7227015

Browse files
committed
use gradle
1 parent 903bd28 commit 7227015

File tree

1 file changed

+57
-68
lines changed

1 file changed

+57
-68
lines changed
+57-68
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Cross-platform Build and Test
2-
32
on:
43
push:
54
branches: [ "master" ]
@@ -22,42 +21,34 @@ jobs:
2221
- x86_64-apple-darwin
2322
- x86_64-pc-windows-gnu
2423
# - aarch64-pc-windows-msvc
25-
2624
steps:
27-
- uses: actions/checkout@v3
28-
29-
- name: Install Rust
30-
uses: actions-rs/toolchain@v1
31-
with:
32-
toolchain: stable
33-
target: ${{ matrix.target }}
34-
override: true
35-
36-
- name: Install cargo-binstall
37-
uses: taiki-e/install-action@cargo-binstall
38-
39-
- name: Install Zig
40-
uses: goto-bus-stop/setup-zig@v2
41-
with:
42-
version: 0.10.1
43-
44-
- name: Install cargo-zigbuild
45-
run: cargo binstall --no-confirm cargo-zigbuild
46-
47-
- name: Set up MinGW (for x86_64 Windows)
48-
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
49-
run: sudo apt-get install gcc-mingw-w64-x86-64 -y
50-
51-
- name: Run compile script
52-
run: |
53-
chmod +x .github/scripts/compile_all_targets_java_new.sh
54-
.github/scripts/compile_all_targets_java_new.sh ${{ matrix.target }}
55-
56-
- name: Upload artifacts
57-
uses: actions/upload-artifact@v3
58-
with:
59-
name: ${{ matrix.target }}
60-
path: target/${{ matrix.target }}/release/*
25+
- uses: actions/checkout@v3
26+
- name: Install Rust
27+
uses: actions-rs/toolchain@v1
28+
with:
29+
toolchain: stable
30+
target: ${{ matrix.target }}
31+
override: true
32+
- name: Install cargo-binstall
33+
uses: taiki-e/install-action@cargo-binstall
34+
- name: Install Zig
35+
uses: goto-bus-stop/setup-zig@v2
36+
with:
37+
version: 0.10.1
38+
- name: Install cargo-zigbuild
39+
run: cargo binstall --no-confirm cargo-zigbuild
40+
- name: Set up MinGW (for x86_64 Windows)
41+
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }}
42+
run: sudo apt-get install gcc-mingw-w64-x86-64 -y
43+
- name: Run compile script
44+
run: |
45+
chmod +x .github/scripts/compile_all_targets_java_new.sh
46+
.github/scripts/compile_all_targets_java_new.sh ${{ matrix.target }}
47+
- name: Upload artifacts
48+
uses: actions/upload-artifact@v3
49+
with:
50+
name: ${{ matrix.target }}-java-code
51+
path: bindings/java/java_code
6152

6253
test:
6354
name: Test on ${{ matrix.os }}
@@ -75,37 +66,35 @@ jobs:
7566
target: aarch64-apple-darwin
7667
- os: windows-latest
7768
target: x86_64-pc-windows-gnu
78-
7969
runs-on: ${{ matrix.os }}
80-
8170
steps:
82-
- uses: actions/checkout@v3
83-
84-
- name: Install Rust
85-
uses: actions-rs/toolchain@v1
86-
with:
87-
toolchain: stable
88-
target: ${{ matrix.target }}
89-
override: true
90-
91-
- name: Download artifacts
92-
uses: actions/download-artifact@v3
93-
with:
94-
name: ${{ matrix.target }}
95-
path: target/${{ matrix.target }}/release
96-
97-
- name: Make binaries executable
98-
if: runner.os != 'Windows'
99-
run: chmod +x target/${{ matrix.target }}/release/*
100-
101-
# Windows has a weird heap allocation error when running tests
102-
# This happens because each test in fk20, will create commit and opening
103-
# keys. Its not clear as to why the tests are not freeing the heap allocations
104-
# on windows, but running the tests on a single thread, fixes it.
105-
- name: Run tests (Windows)
106-
if: runner.os == 'Windows'
107-
run: cargo test --target ${{ matrix.target }} -- --test-threads=1 --nocapture
108-
109-
- name: Run tests
110-
if: runner.os != 'Windows'
111-
run: cargo test --target ${{ matrix.target }}
71+
- uses: actions/checkout@v3
72+
- name: Install Rust
73+
uses: actions-rs/toolchain@v1
74+
with:
75+
toolchain: stable
76+
target: ${{ matrix.target }}
77+
override: true
78+
- name: Download artifacts
79+
uses: actions/download-artifact@v3
80+
with:
81+
name: ${{ matrix.target }}-java-code
82+
path: bindings/java/java_code
83+
84+
- name: List contents of downloaded artifact
85+
run: ls -R bindings/java/java_code
86+
shell: bash
87+
88+
- name: Set up JDK
89+
uses: actions/setup-java@v3
90+
with:
91+
distribution: 'temurin'
92+
java-version: '17'
93+
94+
- name: Build with Gradle (no tests)
95+
run: ./gradlew build -x test
96+
working-directory: bindings/java/java_code
97+
98+
- name: Run Gradle tests
99+
run: ./gradlew test --scan
100+
working-directory: bindings/java/java_code

0 commit comments

Comments
 (0)