Skip to content

Commit

Permalink
Extract elasticsearch launch into its own action, add startup check (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-vovk authored Nov 10, 2024
1 parent c93b424 commit 41b6050
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/actions/launch-elasticsearch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Launch Elastic

runs:
using: 'composite'

steps:
- name: 'Launch elastic docker'
shell: bash
run: |
docker run -d -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
- name: 'Wait for cluster to start'
shell: bash
run: |
curl -s -S --retry 10 --retry-delay 5 --retry-all-errors "localhost:39227/_cluster/health?wait_for_status=green&timeout=50s"
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
uses: ./.github/actions/launch-elasticsearch

- name: run tests
run: sbt ++2.12.20 test
Expand All @@ -47,7 +47,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
uses: ./.github/actions/launch-elasticsearch

- name: run tests
run: sbt ++2.13.15 test
Expand All @@ -67,7 +67,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
uses: ./.github/actions/launch-elasticsearch

- name: run tests
run: sbt ++3.3.4 elastic4s-scala3/test
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
uses: ./.github/actions/launch-elasticsearch

- name: run tests
timeout-minutes: 30
Expand All @@ -44,7 +44,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
uses: ./.github/actions/launch-elasticsearch

- name: run tests
timeout-minutes: 30
Expand All @@ -65,7 +65,7 @@ jobs:
java-version: 11

- name: Launch elastic docker
run: docker run -d -it -p 39227:9200 -p 39337:9300 -e "discovery.type=single-node" -v /home/runner/work/elastic4s/elastic4s/elastic4s-tests/src/test/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml docker.elastic.co/elasticsearch/elasticsearch:8.15.3
uses: ./.github/actions/launch-elasticsearch

- name: run tests
run: sbt ++3.3.4 elastic4s-scala3/test

0 comments on commit 41b6050

Please sign in to comment.