Skip to content

Commit

Permalink
ci: introduce Java 22 and split Native into its own job
Browse files Browse the repository at this point in the history
(cherry picked from commit f1bc864)
  • Loading branch information
triceo committed Mar 21, 2024
1 parent 0cd7cab commit 7d9205e
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 3 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
name: JVM and OS matrix
name: Maven

on:
push:
branches: [stable, development, '*.x']
paths-ignore:
- 'LICENSE*'
- '.gitignore'
- '**.md'
- '**.adoc'
- '*.txt'
pull_request:
branches: [stable, development, '*.x']
paths-ignore:
- 'LICENSE*'
- '.gitignore'
- '**.md'
- '**.adoc'
- '*.txt'

jobs:
build:
Expand All @@ -13,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
java-version: [ 17, 21 ] #Latest two LTS + latest non-LTS.
java-version: [ 17, 21, 22 ] #Latest two LTS + latest non-LTS.
timeout-minutes: 120
steps:
# Clone timefold-solver
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_gradle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gradle CI
name: Gradle

on:
pull_request:
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/pull_request_native.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: GraalVM Native

on:
pull_request:
branches: [stable, development, '*.x']
paths-ignore:
- 'LICENSE*'
- '.gitignore'
- '**.md'
- '**.adoc'
- '*.txt'

jobs:
build:
concurrency:
group: pull_request_native-${{ github.event_name }}-${{ github.head_ref }}-${{ matrix.module }}-${{ matrix.java-version }}
cancel-in-progress: true
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17, 21, 22 ] #Latest two LTS + latest non-LTS.
timeout-minutes: 120
steps:
# Clone timefold-solver
# Need to check for stale repo, since Github is not aware of the build chain and therefore doesn't automate it.
- name: Checkout timefold-solver to access the scripts
uses: actions/checkout@v4
with:
path: './timefold-solver'
repository: 'TimefoldAI/timefold-solver'
- name: Find the proper timefold-solver repo and branch
env:
CHAIN_USER: ${{ github.actor }}
CHAIN_BRANCH: ${{ github.head_ref }}
CHAIN_REPO: "timefold-solver"
CHAIN_DEFAULT_BRANCH: ${{ endsWith(github.head_ref, '.x') && github.head_ref || 'main' }}
shell: bash
run: |
./timefold-solver/.github/scripts/check_chain_repo.sh
rm -rf ./timefold-solver
- name: Checkout the proper timefold-solver branch
uses: actions/checkout@v4
with:
repository: ${{ env.TARGET_CHAIN_USER }}/${{ env.TARGET_CHAIN_REPO }}
ref: ${{ env.TARGET_CHAIN_BRANCH }}
path: './timefold-solver'
fetch-depth: 0 # Otherwise merge in the next step will fail on account of not having history.
- name: Prevent stale fork of timefold-solver
env:
BLESSED_REPO: "timefold-solver"
BLESSED_BRANCH: ${{ endsWith(github.head_ref, '.x') && github.head_ref || 'main' }}
shell: bash
working-directory: ./timefold-solver
run: .github/scripts/prevent_stale_fork.sh

# Clone timefold-quickstarts
# No need to check for stale repo, as Github merges the main repo into the fork automatically.
- name: Checkout timefold-quickstarts
uses: actions/checkout@v4
with:
path: './timefold-quickstarts'

# Build and test
- name: "Setup GraalVM native image"
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{matrix.java-version}}
distribution: 'graalvm-community'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'

- name: Quickly build timefold-solver
working-directory: ./timefold-solver
run: mvn -B -Dquickly clean install
- name: Test timefold-quickstarts in Native mode
working-directory: ./timefold-quickstarts
run: mvn -B -Dnative verify

0 comments on commit 7d9205e

Please sign in to comment.