Skip to content

Commit 2a53478

Browse files
committed
ci: build only the Linux native image per PR
Take the slow, 10x-billed macOS native-image build off the PR critical path to speed up PR builds: - Build only the Linux native image on PRs, in quick-build mode (--quick-build-native / -Ob). The PR binary is only smoke-tested and never shipped, so trading binary runtime performance for a much faster build is free. - Run the native-image job in parallel with the java/integration jobs instead of after them (dropped the `needs`). - Move macOS native-image coverage to a dedicated workflow that runs on push to main plus a weekly backstop, so macOS-specific native regressions are still caught before the Sunday release. Closes #768
1 parent 8553144 commit 2a53478

2 files changed

Lines changed: 62 additions & 6 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: macOS Native Image
2+
3+
# macOS native-image coverage is kept off the per-PR critical path: the macOS
4+
# build is the long pole and macOS runners bill at 10x. Instead we build and
5+
# smoke-test the macOS native image on every push to main (per-merge signal)
6+
# plus a weekly backstop, so macOS-specific native regressions are still caught
7+
# promptly before the Sunday release. PRs build only the Linux native image
8+
# (see pr.yml).
9+
10+
on:
11+
push:
12+
branches:
13+
- main
14+
schedule:
15+
# Saturday 04:23 UTC — backstop ahead of the Sunday release build.
16+
- cron: "23 4 * * 6"
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
isthmus-native-image-macos:
25+
name: Build Isthmus Native Image (macOS)
26+
if: github.repository == 'substrait-io/substrait-java'
27+
runs-on: macOS-latest
28+
steps:
29+
- uses: actions/checkout@v7
30+
with:
31+
submodules: recursive
32+
- uses: actions/setup-java@v5
33+
with:
34+
java-version: 25
35+
distribution: graalvm
36+
- name: Setup Gradle
37+
uses: gradle/actions/setup-gradle@v6
38+
- name: Report Java Version
39+
run: java -version
40+
- name: Build with Gradle
41+
run: |
42+
# fetch submodule tags since actions/checkout@v7 does not
43+
git submodule foreach 'git fetch --unshallow || true'
44+
45+
# Full optimization (no --quick-build-native) so this mirrors the
46+
# release build and catches anything that would break shipping.
47+
./gradlew nativeCompile
48+
- name: Smoke Test
49+
run: |
50+
./isthmus-cli/src/test/script/smoke.sh
51+
./isthmus-cli/src/test/script/tpch_smoke.sh

.github/workflows/pr.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,18 @@ jobs:
9494
git submodule foreach 'git fetch --unshallow || true'
9595
9696
./gradlew integrationTest
97-
isthmus-native-image-mac-linux:
97+
isthmus-native-image-linux:
98+
# Only the Linux native image is built per PR: it validates the GraalVM
99+
# configuration and runs the smoke tests, and its binary is throwaway (only
100+
# smoke-tested, never shipped). macOS-specific native coverage runs in
101+
# native-image-macos.yml (on push to main + a weekly schedule), keeping the
102+
# slow, 10x-billed macOS build off the PR critical path. This job also runs
103+
# in parallel with the java/integration jobs rather than after them.
98104
name: Build Isthmus Native Image
99-
needs:
100-
- java
101-
- integration
102105
runs-on: ${{ matrix.os }}
103106
strategy:
104107
matrix:
105-
os: [ubuntu-latest, macOS-latest]
108+
os: [ubuntu-latest]
106109
steps:
107110
- uses: actions/checkout@v7
108111
with:
@@ -120,7 +123,9 @@ jobs:
120123
# fetch submodule tags since actions/checkout@v7 does not
121124
git submodule foreach 'git fetch --unshallow || true'
122125
123-
./gradlew nativeCompile
126+
# --quick-build-native (-Ob) trades binary runtime performance for a
127+
# much faster build; the PR binary is only smoke-tested, so this is free.
128+
./gradlew nativeCompile --quick-build-native
124129
- name: Smoke Test
125130
run: |
126131
./isthmus-cli/src/test/script/smoke.sh

0 commit comments

Comments
 (0)