From f531aaf18b845517b1da0565e8a987ec447d4e4c Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Tue, 10 May 2022 16:22:48 -0700 Subject: [PATCH] Adding support to test against unreleased OpenSearch (#232) Signed-off-by: Vacha Shah --- .github/workflows/integration-unreleased.yml | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/integration-unreleased.yml diff --git a/.github/workflows/integration-unreleased.yml b/.github/workflows/integration-unreleased.yml new file mode 100644 index 000000000..18d89528d --- /dev/null +++ b/.github/workflows/integration-unreleased.yml @@ -0,0 +1,52 @@ +name: Integration with Unreleased OpenSearch + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + entry: + - { opensearch_ref: '1.x' } + steps: + - name: Checkout OpenSearch + uses: actions/checkout@v2 + with: + repository: opensearch-project/OpenSearch + ref: ${{ matrix.entry.opensearch_ref }} + path: opensearch + + - name: Assemble OpenSearch + 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 + + - name: Checkout Javascript Client + uses: actions/checkout@v2 + + - name: Use Node.js 16.x + uses: actions/setup-node@v1 + with: + node-version: 16.x + + - name: Install + run: | + npm install + + - name: Integration test + run: | + npm run test:integration:helpers