generated from teksi/template
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.45 KB
/
datamodel-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
59
60
61
62
name: 🐘 Datamodel | Tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
paths:
- datamodel/**
- '.github/workflows/datamodel-test.yml'
pull_request:
branches:
- main
paths:
- datamodel/**
- '.github/workflows/datamodel-test.yml'
workflow_dispatch:
jobs:
datamodel-tests:
name: Run unit tests on datamodel
runs-on: ubuntu-latest
strategy:
matrix:
psycopg-version: [ 2, 3 ]
fail-fast: true
steps:
- uses: actions/checkout@v4
- name: Docker build
run: |
docker build \
--build-arg RUN_TEST=True \
--build-arg PSYCOPG_VERSION=${{ matrix.psycopg-version }} \
-f datamodel/.docker/Dockerfile \
--tag teksi/distance_heating:unstable .
- name: Initialize container
run: |
docker run -d -p 5432:5432 --name teksi-distance_heating teksi/distance_heating:unstable
docker exec teksi-distance_heating init_db.sh wait
- name: Run tests
run: docker exec teksi-distance_heating pytest datamodel
- name: Docker logs
if: failure()
run: docker logs teksi-distance_heating
static-tests:
name: Run static tests on datamodel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./datamodel/test/static_tests.sh