Skip to content

HSEARCH-5676 Add compatibility with Elasticsearch 9.5 #1960

HSEARCH-5676 Add compatibility with Elasticsearch 9.5

HSEARCH-5676 Add compatibility with Elasticsearch 9.5 #1960

Workflow file for this run

# SPDX-License-Identifier: Apache-2.0
# Copyright Red Hat Inc. and Hibernate Authors
# This is not the main CI job, but it is useful on forks.
# See MAINTAINERS.md for details about all available CI jobs.
name: GH Actions CI
on:
push:
branches:
# Pattern order matters: the last matching inclusion/exclusion wins
- '**'
- '!3.*'
- '!4.*'
- '!5.*'
- '!6.*'
# We don't want to run CI on branches for dependabot, just on the PR.
- '!dependabot/**'
- '!wip/**/dependency-update/**'
tags:
- '**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
# Pattern order matters: the last matching inclusion/exclusion wins
- '**'
- '!3.*'
- '!4.*'
- '!5.*'
- '!6.*'
# Ignore dependabot PRs that are not just about build dependencies or workflows;
# we'll reject such PRs and send one ourselves.
- '!dependabot/**'
- 'dependabot/maven/build-dependencies-**'
- 'dependabot/github_actions/workflow-actions-**'
- 'dependabot/docker/**/build-containers-**'
- 'dependabot/docker/**/database-containers-**'
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-search' }}
defaults:
run:
shell: bash
env:
MAVEN_ARGS: "-e -B --settings .github/mvn-settings.xml --fail-at-end"
TESTCONTAINERS_REUSE_ENABLE: true
permissions: { } # none, jobs are defining their own if they need any
jobs:
build:
name: ${{matrix.os.name}}
runs-on: ${{ matrix.os.runs-on }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os:
- {
name: "Linux JDK 25",
runs-on: 'ubuntu-latest',
java: {
version: 25
},
maven: {
# Since we only start an Elasticsearch container on Linux we add the profile to enable container reuse here:
args: '-Pci-build'
},
reporting: {
coverage: false,
docs-preview: true
}
}
# We can't start Linux containers on GitHub Actions' Windows VMs,
# so we can't run Elasticsearch tests.
# See https://github.com/actions/runner-images/issues/1143#issuecomment-972929995
- {
name: "Windows JDK 25",
runs-on: 'windows-latest',
java: {
version: 25
},
maven: {
args: '-Dtest.elasticsearch.skip=true'
},
reporting: {
coverage: false,
docs-preview: false
}
}
steps:
- name: Support longpaths on Windows
if: "startsWith(matrix.os.runs-on, 'windows')"
run: git config --global core.longpaths true
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 7.0.1
with:
persist-credentials: false
# Fetch the whole history to make sure that gitflow incremental builder
# can find the base commit.
fetch-depth: 0
- name: Set up Java ${{ matrix.os.java.version }}
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # 5.6.0
with:
java-version: ${{ matrix.os.java.version }}
distribution: temurin
# https://github.com/actions/cache/blob/main/examples.md#java---maven
- name: Cache local Maven repository
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # 6.1.0
with:
path: ~/.m2/repository
# use a different key than workflows running in trusted mode
key: ${{ github.event_name == 'push' && 'trusted' || 'untrusted' }}-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ github.event_name == 'push' && 'trusted' || 'untrusted' }}-${{ runner.os }}-maven-
- name: Set up Maven
run: ./mvnw -v
- name: Docker cleanup
run: ./ci/docker-cleanup.sh
- name: Build code and run unit tests and basic checks
run: |
read -ra mvn_args <<< "$MAVEN_ARGS"
read -ra mvn_matrix_args <<< "$MAVEN_MATRIX_ARGS"
./mvnw "${mvn_args[@]}" "${mvn_matrix_args[@]}" clean install \
-Pjqassistant -Pdist -Pci-build -DskipITs
env:
DEVELOCITY_ACCESS_KEY: "${{ secrets.DEVELOCITY_ACCESS_KEY || '' }}"
DEVELOCITY_BASE_URL: "${{ env.DEVELOCITY_BASE_URL || 'https://develocity.commonhaus.dev' }}"
MAVEN_MATRIX_ARGS: ${{ matrix.os.maven.args }}
# For jobs running on 'pull_request', upload build scan data.
# The actual publishing must be done in a separate job (see ci-report.yml).
# We don't write to the remote cache as that would be unsafe.
- name: Upload GitHub Actions artifact for the Develocity build scan
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
if: "${{ github.event_name == 'pull_request' && !cancelled() }}"
with:
name: build-scan-data-initial-${{ matrix.os.name }}
path: ~/.m2/.develocity/build-scan-data
- name: Upload docs preview
if: ${{ matrix.os.reporting.docs-preview }}
uses: hibernate/.github/actions/build-docs-preview@197125e1a0e9624349ef9e8157dad8ab707f3da0 # main
with:
dist-path: 'documentation/target/dist'
src-paths: |
documentation/src
- name: Run integration tests in the default environment
run: |
read -ra mvn_args <<< "$MAVEN_ARGS"
read -ra mvn_matrix_args <<< "$MAVEN_MATRIX_ARGS"
read -ra mvn_incremental <<< "$MAVEN_INCREMENTAL_BUILD"
./mvnw "${mvn_args[@]}" "${mvn_matrix_args[@]}" clean verify \
-Pskip-checks \
"${mvn_incremental[@]}"
env:
DEVELOCITY_ACCESS_KEY: "${{ secrets.DEVELOCITY_ACCESS_KEY || '' }}"
DEVELOCITY_BASE_URL: "${{ env.DEVELOCITY_BASE_URL || 'https://develocity.commonhaus.dev' }}"
MAVEN_MATRIX_ARGS: ${{ matrix.os.maven.args }}
MAVEN_INCREMENTAL_BUILD: ${{ github.event.pull_request.base.ref && format('-Dincremental -Dgib.referenceBranch=refs/remotes/origin/{0}', github.event.pull_request.base.ref) || '' }}
# Same as above, but for the build scan of the latest Maven run.
- name: Upload GitHub Actions artifact for the Develocity build scan
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # 7.0.1
if: "${{ github.event_name == 'pull_request' && !cancelled() }}"
with:
name: build-scan-data-integrationtest-${{ matrix.os.name }}
path: ~/.m2/.develocity/build-scan-data
- name: Docker cleanup
run: ./ci/docker-cleanup.sh
- name: Omit produced artifacts from build cache
run: rm -r ~/.m2/repository/org/hibernate/search