From 64686c8020a65ac718282a8fc8773a7fb5a75395 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Mon, 13 May 2024 10:46:43 -0500 Subject: [PATCH] Test against Elastic 7 and 8 --- .github/workflows/ci.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47b2acb..c9561c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ jobs: test: name: Test runs-on: ubuntu-latest + strategy: + matrix: + elastic-port: [9207, 9208] services: postgres: @@ -17,13 +20,18 @@ jobs: ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 - elastic: - image: elasticsearch:7.17.9 - ports: - - 9200:9200 - - 9300:9300 - env: - discovery.type: single-node + elastic7: + image: elasticsearch:7.17.9 + ports: + - 9207:9200 + env: + discovery.type: single-node + elastic8: + image: elasticsearch:8.13.4 + ports: + - 9208:9200 + env: + discovery.type: single-node steps: - name: Checkout code @@ -34,6 +42,10 @@ jobs: with: go-version: ${{ env.go-version }} + - name: Setup environment + run: | + echo "INDEXER_ELASTIC_URL=http://localhost:${{ matrix.elastic-port }}" >> "$GITHUB_ENV" + - name: Run tests run: go test -p=1 -coverprofile=coverage.text -covermode=atomic ./...