Skip to content

Commit 372d241

Browse files
committed
update gh workflow
1 parent aa8a97d commit 372d241

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

.github/workflows/cicd.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
timeout-minutes: 20
1616

1717
services:
18-
1918
elasticsearch_8_svc:
2019
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
2120
env:
@@ -63,22 +62,31 @@ jobs:
6362
OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m
6463
ports:
6564
- 9202:9202
65+
6666
strategy:
6767
matrix:
6868
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12"]
69+
backend: [ "elasticsearch7", "elasticsearch8", "opensearch"]
6970

70-
name: Python ${{ matrix.python-version }} testing
71+
name: Python ${{ matrix.python-version }} testing with ${{ matrix.backend }}
7172

7273
steps:
7374
- name: Check out repository code
7475
uses: actions/checkout@v4
7576

76-
# Setup Python (faster than using Python container)
7777
- name: Setup Python
7878
uses: actions/setup-python@v5
7979
with:
8080
python-version: ${{ matrix.python-version }}
8181

82+
- name: Cache pipenv packages
83+
uses: actions/cache@v3
84+
with:
85+
path: ~/.cache/pip
86+
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
87+
restore-keys: |
88+
${{ runner.os }}-pip-
89+
8290
- name: Lint code
8391
if: ${{ matrix.python-version == 3.11 }}
8492
run: |
@@ -101,35 +109,17 @@ jobs:
101109
run: |
102110
pip install ./stac_fastapi/opensearch[dev,server]
103111
104-
- name: Run test suite against Elasticsearch 7.x
105-
run: |
106-
pipenv run pytest -svvv
107-
env:
108-
ENVIRONMENT: testing
109-
ES_PORT: 9400
110-
ES_HOST: 172.17.0.1
111-
ES_USE_SSL: false
112-
ES_VERIFY_CERTS: false
113-
BACKEND: elasticsearch
114-
115-
- name: Run test suite against Elasticsearch 8.x
112+
- name: Install pytest-timeout
116113
run: |
117-
pipenv run pytest -svvv
118-
env:
119-
ENVIRONMENT: testing
120-
ES_PORT: 9200
121-
ES_HOST: 172.17.0.1
122-
ES_USE_SSL: false
123-
ES_VERIFY_CERTS: false
124-
BACKEND: elasticsearch
114+
pip install pytest-timeout
125115
126-
- name: Run test suite against OpenSearch 2.11.1
116+
- name: Run test suite
127117
run: |
128-
pipenv run pytest -svvv
118+
pipenv run pytest -svvv --timeout=300
129119
env:
130120
ENVIRONMENT: testing
131-
ES_PORT: 9202
121+
ES_PORT: ${{ matrix.backend == 'elasticsearch7' && '9400' || matrix.backend == 'elasticsearch8' && '9200' || '9202' }}
132122
ES_HOST: 172.17.0.1
133123
ES_USE_SSL: false
134124
ES_VERIFY_CERTS: false
135-
BACKEND: opensearch
125+
BACKEND: ${{ matrix.backend == 'elasticsearch7' && 'elasticsearch' || matrix.backend == 'elasticsearch8' && 'elasticsearch' || 'opensearch' }}

0 commit comments

Comments
 (0)