Skip to content

Fix incorrect variable name #374

Fix incorrect variable name

Fix incorrect variable name #374

Workflow file for this run

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:
- { ruby_version: '3.3', opensearch_ref: '1.x' }
- { ruby_version: '3.3', opensearch_ref: '2.x' }
- { ruby_version: '3.3', opensearch_ref: '2.0' }
- { ruby_version: '3.3', opensearch_ref: 'main' }
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby_version }}
- name: Checkout OpenSearch
uses: actions/checkout@v3
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@v3
with:
path: opensearch/distribution/archives/linux-tar/build/distributions
key: ${{ steps.get-key.outputs.key }}
- 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: |
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 Ruby Client
uses: actions/checkout@v3
with:
path: ruby-client
- name: Build and test with Rake
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
ruby -v
bundle install
working-directory: ruby-client
- name: opensearch-ruby
working-directory: ruby-client
run: rake test:integration
- name: Save server logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: opensearch-logs-${{ matrix.entry.opensearch_ref }}-ruby-${{ matrix.entry.ruby_version }}
path: |
opensearch/distribution/archives/linux-tar/build/distributions/**/logs/*