Skip to content

Commit 4b0c0e8

Browse files
committed
GHA | added wait for ES and ulimits
1 parent 60689f6 commit 4b0c0e8

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
--health-retries 5
4949
es:
5050
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.2
51+
options: >-
52+
--ulimit memlock=-1:-1
53+
--ulimit nofile=65536:65536
5154
ports:
5255
- 9200:9200
5356
env:
@@ -74,10 +77,16 @@ jobs:
7477
python -m venv venv
7578
. venv/bin/activate
7679
pip install --cache-dir ~/.cache/pip -r requirements.txt
77-
# - name: DB Setup
78-
# run: |
79-
# python manage.py migrate
80-
# python manage.py loaddata core/fixtures/*
80+
- name: Wait for Elasticsearch HTTP
81+
run: |
82+
echo "Waiting for Elasticsearch..."
83+
for i in {1..30}; do
84+
curl -s http://es:9200 >/dev/null && echo "ES is ready!" && exit 0
85+
echo "ES not ready yet..."
86+
sleep 2
87+
done
88+
echo "Elasticsearch failed to start" >&2
89+
exit 1
8190
- name: Run Tests
8291
env:
8392
DB_HOST: db

0 commit comments

Comments
 (0)