-
Notifications
You must be signed in to change notification settings - Fork 59
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
Adds newer OpenSearch builds to integration tests and updates unreleased to use new caching mechanism #143
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,37 +14,58 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
entry: | ||
- { opensearch_ref: '1.x' } | ||
- { opensearch_ref: '2.0' } | ||
- { opensearch_ref: '2.x' } | ||
- { opensearch_ref: 'main' } | ||
opensearch_ref: [ '1.x', '2.x', '2.0', 'main' ] | ||
steps: | ||
- name: Checkout OpenSearch | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: opensearch-project/OpenSearch | ||
ref: ${{ matrix.entry.opensearch_ref }} | ||
ref: ${{ matrix.opensearch_ref }} | ||
path: opensearch | ||
|
||
- name: Get OpenSearch branch top | ||
id: get-key | ||
working-directory: opensearch | ||
run: echo key=`git log -1 --format='%H'` >> $GITHUB_OUTPUT | ||
|
||
- name: Restore cached build | ||
id: cache-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: opensearch/distribution/archives/linux-tar/build/distributions | ||
key: ${{ steps.get-key.outputs.key }} | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' # See 'Supported distributions' for available options | ||
java-version: '11' | ||
|
||
- name: Assemble OpenSearch | ||
if: steps.cache-restore.outputs.cache-hit != 'true' | ||
working-directory: opensearch | ||
run: ./gradlew :distribution:archives:linux-tar:assemble | ||
|
||
- name: Save cached build | ||
if: steps.cache-restore.outputs.cache-hit != 'true' | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: opensearch/distribution/archives/linux-tar/build/distributions | ||
key: ${{ steps.get-key.outputs.key }} | ||
|
||
- name: Run OpenSearch | ||
working-directory: opensearch/distribution/archives/linux-tar/build/distributions | ||
run: | | ||
cd opensearch | ||
./gradlew assemble | ||
# This step runs the docker image generated during gradle assemble in OpenSearch. It is tagged as opensearch:test. | ||
# Reference: https://github.com/opensearch-project/OpenSearch/blob/2.0/distribution/docker/build.gradle#L190 | ||
- name: Run Docker Image | ||
run: | | ||
docker run -p 9200:9200 -p 9600:9600 -d -e "discovery.type=single-node" -e "bootstrap.memory_lock=true" opensearch:test | ||
sleep 90 | ||
tar xf opensearch-min-* | ||
./opensearch-*/bin/opensearch & | ||
for attempt in {1..20}; do sleep 5; if curl -s localhost:9200; then echo '=====> ready'; break; fi; echo '=====> waiting...'; done | ||
|
||
- name: Checkout PHP Client | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use PHP 8.1 | ||
- name: Use PHP 8.2 | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
php-version: 8.2 | ||
extensions: yaml, zip, curl | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -53,9 +74,6 @@ jobs: | |
run: | | ||
composer install --prefer-dist | ||
|
||
- name: Wait for Search server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can leave the wait for server script so that cluster is available when the integration tests run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea maybe it is the wait for script for the cluster error |
||
run: php ./.github/wait_for_es.php | ||
|
||
- name: Integration tests | ||
run: | | ||
composer run integration | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think setting up java is needed here.