1
1
name : stac-fastapi
2
2
on :
3
3
push :
4
- branches : [ master ]
4
+ branches : [master]
5
5
pull_request :
6
- branches : [ master ]
6
+ branches : [master]
7
7
8
8
jobs :
9
9
test :
10
10
runs-on : ubuntu-latest
11
11
strategy :
12
12
matrix :
13
- python-version : [ ' 3.8', ' 3.9', ' 3.10' ]
13
+ python-version : [" 3.8", " 3.9", " 3.10" ]
14
14
timeout-minutes : 10
15
15
16
16
services :
@@ -118,9 +118,69 @@ jobs:
118
118
POSTGRES_HOST_READER : localhost
119
119
POSTGRES_HOST_WRITER : localhost
120
120
POSTGRES_PORT : 5432
121
+
122
+ validate :
123
+ runs-on : ubuntu-latest
124
+ strategy :
125
+ fail-fast : false
126
+ matrix :
127
+ backend : ["sqlalchemy", "pgstac"]
128
+ services :
129
+ pgstac :
130
+ image : ghcr.io/stac-utils/pgstac:v0.6.11
131
+ env :
132
+ POSTGRES_USER : username
133
+ POSTGRES_PASSWORD : password
134
+ POSTGRES_DB : postgis
135
+ PGUSER : username
136
+ PGPASSWORD : password
137
+ PGDATABASE : postgis
138
+ options : >-
139
+ --health-cmd pg_isready
140
+ --health-interval 10s
141
+ --health-timeout 5s
142
+ --health-retries 5
143
+ ports :
144
+ - 5432:5432
145
+ steps :
146
+ - name : Check out repository code
147
+ uses : actions/checkout@v3
148
+ - name : Setup Python
149
+ uses : actions/setup-python@v3
150
+ with :
151
+ python-version : " 3.10"
152
+ cache : pip
153
+ cache-dependency-path : stac_fastapi/pgstac/setup.cfg
154
+ - name : Install stac-fastapi and stac-api-validator
155
+ run : pip install ./stac_fastapi/api ./stac_fastapi/types ./stac_fastapi/${{ matrix.backend }}[server] stac-api-validator==0.4.1
156
+ - name : Run migration
157
+ if : ${{ matrix.backend == 'sqlalchemy' }}
158
+ run : cd stac_fastapi/sqlalchemy && alembic upgrade head
159
+ env :
160
+ POSTGRES_USER : username
161
+ POSTGRES_PASS : password
162
+ POSTGRES_DBNAME : postgis
163
+ POSTGRES_HOST : localhost
164
+ POSTGRES_PORT : 5432
165
+ - name : Load data and validate
166
+ run : python -m stac_fastapi.${{ matrix.backend }}.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
167
+ env :
168
+ POSTGRES_USER : username
169
+ POSTGRES_PASS : password
170
+ POSTGRES_DBNAME : postgis
171
+ POSTGRES_HOST_READER : localhost
172
+ POSTGRES_HOST_WRITER : localhost
173
+ POSTGRES_PORT : 5432
174
+ PGUSER : username
175
+ PGPASSWORD : password
176
+ PGHOST : localhost
177
+ PGDATABASE : postgis
178
+ APP_HOST : 0.0.0.0
179
+ APP_PORT : 8080
180
+
121
181
test-docs :
122
182
runs-on : ubuntu-latest
123
183
steps :
124
184
- uses : actions/checkout@v3
125
185
- name : Test generating docs
126
- run : make docs
186
+ run : make docs
0 commit comments