-
Notifications
You must be signed in to change notification settings - Fork 22
88 lines (75 loc) · 2.36 KB
/
Copy pathcommit.yml
File metadata and controls
88 lines (75 loc) · 2.36 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: 1 - Commit
on: [push]
permissions:
contents: write
env:
PY_VERSION: "3.12.14"
POETRY_VERSION: "latest"
jobs:
lint:
runs-on: ubuntu-latest
name: Python Lint
steps:
- name: Check out the code
uses: actions/checkout@v7
with:
fetch-depth: 1
submodules: true
- name: Set up Python ${{ env.PY_VERSION }}
uses: actions/setup-python@v7
with:
python-version: ${{ env.PY_VERSION }}
- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ env.POETRY_VERSION }}
poetry-plugins: "poetry-plugin-export"
- name: Install Dependencies
run: |
poetry env use ${{ env.PY_VERSION }}
poetry install
- name: Run linting
run: make lint-check
test:
environment: development
env:
CF_SERVICE_USER: ${{secrets.CF_SERVICE_USER}}
CF_SERVICE_AUTH: ${{secrets.CF_SERVICE_AUTH}}
FLASK_APP_SECRET_KEY: ${{secrets.FLASK_APP_SECRET_KEY}}
runs-on: ubuntu-latest
name: Pytests
steps:
- name: Check out the code
uses: actions/checkout@v7
with:
fetch-depth: 1
submodules: true
- name: Create local .env from sample
run: cp .env.sample .env
- name: Set up Python ${{ env.PY_VERSION }}
uses: actions/setup-python@v7
with:
python-version: ${{ env.PY_VERSION }}
- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ env.POETRY_VERSION }}
poetry-plugins: "poetry-plugin-export"
- name: Install Dependencies
run: |
poetry env use ${{ env.PY_VERSION }}
poetry install
- name: Run Pytest
run: make test-ci
- name: Verify database/interface.py imports standalone
run: poetry run python -c "import database.interface"
- name: Verify migrations match vendored models
run: docker compose exec -T app flask db check
- name: Report test coverage
uses: MishaKav/pytest-coverage-comment@main
continue-on-error: true
with:
pytest-coverage-path: ""
multiple-files: |
Unit tests, pytest-coverage-unit.txt, pytest-unit.xml
Integration Tests, pytest-coverage-integration.txt, pytest-integration.xml