Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract ElasticSearch launch into its own action, wait until ElasticSearch starts #3207

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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