-
Notifications
You must be signed in to change notification settings - Fork 13
75 lines (66 loc) · 2 KB
/
test_runner.yaml
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
name: Tests
on: [push]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
check:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install deps
run: |
# ensure requirements .txt files are timestamped later than .in
# files so we don't re-compile them
touch requirements.*.txt
make devenv
- name: Run all pre-commit checks
run: |
source ${{ github.workspace }}/venv/bin/activate
pre-commit run --all-files
test:
name: Run test suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install deps
run: |
# ensure requirements .txt files are timestamped later than .in
# files so we don't re-compile them
touch requirements.*.txt
make devenv
- name: Start SQL Server and Trino instances for the tests
run: docker-compose up -d mssql trino
- name: Run tests
run: |
source ${{ github.workspace }}/venv/bin/activate
PYTHONPATH=. pytest -vvv tests/
docker-tests:
name: Test docker build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Build docker
run: make docker-build ENV=dev
- name: Basic docker test
run: docker-compose run --rm -v $PWD:/workspace dev cohortextractor
- name: Run unit tests in docker
run: docker-compose run --rm -v $PWD:/workspace dev pytest
build:
name: Test we can build PyPI package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install wheel package
run: pip install wheel
- name: Build package
run: python setup.py sdist bdist_wheel