-
Notifications
You must be signed in to change notification settings - Fork 13
74 lines (62 loc) · 1.59 KB
/
pytest.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
63
64
65
66
67
68
69
70
71
72
73
74
name: Run Tests
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.rst'
- '**.md'
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
- '.github/dependabot.yml'
workflow_call:
jobs:
test:
name: pytest with coverage
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Install system packages
run: |
sudo apt-get install -y socat
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
# Install
- name: Install so3g
run: |
pip3 install so3g
- name: clone socs
uses: actions/checkout@v4
- name: Install socs
run: |
pip3 install -r requirements.txt
pip3 install -e .
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not integtest'
- name: Build docker test images
run: |
docker compose build socs
# Integration Tests
- name: Run integration tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
# Coverage
- name: Report test coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv ./tests/.coverage.* ./
pip install -U coveralls
coverage combine
coverage report
coveralls --service=github