File tree Expand file tree Collapse file tree 2 files changed +51
-53
lines changed
Expand file tree Collapse file tree 2 files changed +51
-53
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Python Tests with Elasticsearch
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ services :
13+ elasticsearch :
14+ image : docker.elastic.co/elasticsearch/elasticsearch:7.17.10
15+ ports :
16+ - 9200:9200
17+ options : >-
18+ --health-cmd "curl -s http://localhost:9200/_cluster/health | grep -q '\"status\":\"green\"'"
19+ --health-interval 10s
20+ --health-timeout 120s
21+ --health-retries 10
22+ env :
23+ discovery.type : single-node
24+ ES_JAVA_OPTS : " -Xms2g -Xmx2g"
25+
26+ steps :
27+ - name : Checkout repository
28+ uses : actions/checkout@v3
29+
30+ - name : Set up Python 3.11
31+ uses : actions/setup-python@v4
32+ with :
33+ python-version : 3.11
34+
35+ - name : Install dependencies
36+ run : |
37+ python -m pip install --upgrade pip
38+ pip install -r requirements.txt
39+
40+ - name : Wait for Elasticsearch to be ready
41+ run : |
42+ until curl -s http://localhost:9200 >/dev/null; do
43+ echo "Waiting for Elasticsearch..."
44+ sleep 5
45+ done
46+
47+ - name : Run pytest tests
48+ env :
49+ ES_HOST : http://localhost:9200
50+ run : |
51+ pytest tests/
You can’t perform that action at this time.
0 commit comments