Skip to content

Bump lycheeverse/lychee-action from 1.5.0 to 2.1.0 (#928) #1770

Bump lycheeverse/lychee-action from 1.5.0 to 2.1.0 (#928)

Bump lycheeverse/lychee-action from 1.5.0 to 2.1.0 (#928) #1770

name: Integration with Unreleased OpenSearch
on:
push:
branches:
- 'main'
paths-ignore:
- '**/*.md'
pull_request:
branches:
- 'main'
paths-ignore:
- '**/*.md'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- { node_version: '18.x', opensearch_ref: '1.x', jdk_version: '11' }
- { node_version: '18.x', opensearch_ref: '2.x', jdk_version: '17' }
- { node_version: '18.x', opensearch_ref: 'main', jdk_version: '17' }
steps:
- name: Checkout OpenSearch
uses: actions/checkout@v4
with:
repository: opensearch-project/OpenSearch
ref: ${{ matrix.entry.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@v4
with:
path: opensearch/distribution/archives/linux-tar/build/distributions
key: ${{ steps.get-key.outputs.key }}
- name: Setup Java JDK
uses: actions/setup-java@v4
if: steps.cache-restore.outputs.cache-hit != 'true'
with:
distribution: 'temurin'
java-version: ${{ matrix.entry.jdk_version || '17' }}
- name: Assemble OpenSearch
if: steps.cache-restore.outputs.cache-hit != 'true'
working-directory: opensearch
run: ./gradlew :distribution:archives:linux-tar:assemble --stacktrace
- name: Save cached build
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
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: |
tar xf opensearch-min-*
./opensearch-*/bin/opensearch \
-Enode.attr.testattr=test \
-Epath.repo=/tmp \
-Erepositories.url.allowed_urls='http://snapshot.*' \
-d
for attempt in {1..20}; do
sleep 5
if curl -s localhost:9200; then
echo '=====> ready'
exit 0
fi
echo '=====> waiting...'
done
exit 1
- name: Checkout Javascript Client
uses: actions/checkout@v4
with:
path: js-client
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.entry.node_version }}
- name: Install
working-directory: js-client
run: |
npm install
- name: Integration test
working-directory: js-client
run: |
npm run test:integration:helpers
- name: Save server logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: opensearch-logs-${{ matrix.entry.opensearch_ref }}-js-${{ matrix.entry.node_version }}
path: |
opensearch/distribution/archives/linux-tar/build/distributions/**/logs/*