Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: build OpenSearch with the correct Java/Gradle combination. #234

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions .github/workflows/test_unreleased.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ jobs:
strategy:
fail-fast: false
matrix:
opensearch_ref: [ '1.x', '2.x', 'main' ]
entry:
- { opensearch_ref: "1.x", java: 11 }
- { opensearch_ref: "2.x", java: 11, gradle-runtime: 17 }
- { opensearch_ref: "main", java: 11, gradle-runtime: 17 }
steps:
- name: Checkout PHP Client
uses: actions/checkout@v4
Expand All @@ -26,7 +29,7 @@ jobs:
extensions: yaml, zip, curl
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: |
composer install --prefer-dist
Expand All @@ -35,7 +38,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: opensearch-project/OpenSearch
ref: ${{ matrix.opensearch_ref }}
ref: ${{ matrix.entry.opensearch_ref }}
path: opensearch

- name: Get OpenSearch branch top
Expand All @@ -50,16 +53,28 @@ jobs:
path: opensearch/distribution/archives/linux-tar/build/distributions
key: ${{ steps.get-key.outputs.key }}

- uses: actions/setup-java@v4
if: steps.cache-restore.outputs.cache-hit != 'true'
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.entry.java }}
distribution: temurin

- name: Set up Gradle JDK runtime
if: matrix.entry.gradle-runtime && matrix.entry.gradle-runtime != matrix.entry.java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
java-version: ${{ matrix.entry.gradle-runtime }}
distribution: temurin

- name: Set JAVA${{ matrix.entry.java }}_HOME
shell: bash
run: |
echo "JAVA${{ matrix.entry.java }}_HOME=$JAVA_HOME_${{ matrix.entry.java }}_${{ runner.arch }}" >> $GITHUB_ENV
- name: Assemble OpenSearch
if: steps.cache-restore.outputs.cache-hit != 'true'
working-directory: opensearch
run: ./gradlew :distribution:archives:linux-tar:assemble --warning-mode none
run: ./gradlew :distribution:archives:linux-tar:assemble -Druntime.java=${{ matrix.entry.java }}

- name: Save cached build
if: steps.cache-restore.outputs.cache-hit != 'true'
Expand All @@ -73,12 +88,12 @@ jobs:
run: |
tar xf opensearch-min-*
./opensearch-*/bin/opensearch -d
- name: Wait for Search server
run: php ./.github/wait_for_opensearch.php

- name: Integration tests
run: |
composer run integration-min
env:
OPENSEARCH_URL: 'http://localhost:9200'
OPENSEARCH_URL: "http://localhost:9200"
Loading