-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (51 loc) · 1.77 KB
/
contract-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Contract Tests
on:
- push
- pull_request
jobs:
contract-tests:
name: Validate and test the contract of fastgeoapi against the generated pygeoapi OpenAPI document
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/[email protected]
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"
- name: Upgrade pip
run: |
pip install --constraint=$GITHUB_WORKSPACE/.github/workflows/constraints.txt pip
pip --version
- name: Upgrade pip in virtual environments
shell: python
run: |
import os
import pip
with open(os.environ["GITHUB_ENV"], mode="a") as io:
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=$GITHUB_WORKSPACE/.github/workflows/constraints.txt poetry
poetry --version
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev
- name: Install fastgeoapi and run the server with API-KEY protection
env:
ENV_STATE: dev
OPA_ENABLED: false
API_KEY_ENABLED: true
JWKS_ENABLED: false
run: |
poetry install
ENV_STATE=$ENV_STATE
OPA_ENABLED=$OPA_ENABLED
API_KEY_ENABLED=$API_KEY_ENABLED
JWKS_ENABLED=$JWKS_ENABLED
poetry run uvicorn app.main:app --host 0.0.0.0 --port 5000 --reload --loop asyncio &
- name: Run schemathesis command and tests
run: |
poetry run py.test tests/test_openapi_contract.py -vv