50 lines (45 loc) · 1.26 KB
/
lint-and-test.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
name: lint-and-test
on: push
jobs:
check:
runs-on: ubuntu-latest
name: Check (on Python3.8)
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/checkout@v2
- uses: pre-commit/action@v2.0.0
test:
needs: check
runs-on: ubuntu-latest
#strategy: # TODO: make work with pre-commit
# matrix:
# python-version: [ '3.8', '3.6' ]
name: "Test (on Python3.8)"
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/checkout@v2
- run: ci/SETUP.sh
- run: make test
env:
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: flexmeasures_test
PGDB: flexmeasures_test
PGPASSWORD: flexmeasures_test
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:12.5
env:
POSTGRES_USER: flexmeasures_test
POSTGRES_PASSWORD: flexmeasures_test
POSTGRES_DB: flexmeasures_test
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5