diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 658b97f870..201408edcc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -183,8 +183,8 @@ jobs: with: parallel-finished: true - integration-tests-elasticsearch: - name: Integration / Elasticsearch / ${{ matrix.os }} + integration-tests-elasticsearch7: + name: Integration / Elasticsearch7 / ${{ matrix.os }} needs: - unit-tests strategy: @@ -194,12 +194,10 @@ jobs: runs-on: ${{ matrix.os }} services: elasticsearch: - image: elasticsearch:8.7.1 + image: elasticsearch:7.17.6 env: discovery.type: "single-node" - xpack.security.enabled: "false" ES_JAVA_OPTS: "-Xms128m -Xmx256m" - ELASTIC_CLIENT_APIVERSIONING: 1 ports: - 9200:9200 steps: @@ -247,6 +245,69 @@ jobs: - "branch:${{ github.ref_name }}" - "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + integration-tests-elasticsearch8: + name: Integration / Elasticsearch8 / ${{ matrix.os }} + needs: + - unit-tests + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + services: + elasticsearch: + image: elasticsearch:8.8.0 + env: + discovery.type: "single-node" + xpack.security.enabled: "false" + ES_JAVA_OPTS: "-Xms128m -Xmx256m" + ports: + - 9200:9200 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Haystack + run: pip install .[elasticsearch8,dev,preprocessing,inference] + + - name: Run tests + run: | + pytest --maxfail=5 -m "document_store and integration" test/document_stores/test_elasticsearch.py + + - name: Calculate alert data + id: calculator + shell: bash + if: (success() || failure()) && github.ref_name == 'main' + run: | + if [ "${{ job.status }}" = "success" ]; then + echo "alert_type=success" >> "$GITHUB_OUTPUT"; + else + echo "alert_type=error" >> "$GITHUB_OUTPUT"; + fi + + - name: Send event to Datadog + if: (success() || failure()) && github.ref_name == 'main' + uses: masci/datadog@v1 + with: + api-key: ${{ secrets.CORE_DATADOG_API_KEY }} + api-url: https://api.datadoghq.eu + events: | + - title: "${{ github.workflow }} workflow" + text: "Job ${{ github.job }} in branch ${{ github.ref_name }}" + alert_type: "${{ steps.calculator.outputs.alert_type }}" + source_type_name: "Github" + host: ${{ github.repository_owner }} + tags: + - "project:${{ github.repository }}" + - "job:${{ github.job }}" + - "run_id:${{ github.run_id }}" + - "workflow:${{ github.workflow }}" + - "branch:${{ github.ref_name }}" + - "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + integration-tests-sql: name: Integration / SQL / ${{ matrix.os }} needs: @@ -761,7 +822,8 @@ jobs: # This way we'll be able to mark only this test as required # and skip it accordingly. needs: - - integration-tests-elasticsearch + - integration-tests-elasticsearch7 + - integration-tests-elasticsearch8 - integration-tests-sql - integration-tests-opensearch - integration-tests-dc