-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (53 loc) · 1.63 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
51
52
53
54
55
56
57
58
name: lint-and-test
on: push
jobs:
check:
runs-on: ubuntu-latest
name: Check (on Python3.9)
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: actions/checkout@v2
- uses: pre-commit/[email protected]
test:
needs: check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py_version: [ '3.9' ]
name: "Test (on Python ${{ matrix.py_version }})"
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py_version }}
- name: Check out src from Git
uses: actions/checkout@v2
- name: Get history and tags for SCM versioning to work
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
sudo apt-get update
sudo apt-get -y install postgresql-client
psql -h $PGHOST -p $PGPORT --file scripts/load-psql-extensions.sql -U $PGUSER $PGDB;
- 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