-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (57 loc) · 1.46 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
name: Run Tests
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.rst'
- '**.md'
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
workflow_call:
jobs:
test:
name: pytest with coverage
runs-on: ubuntu-latest
steps:
# Setup
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
# Install
- name: clone ocs
uses: actions/checkout@v4
- name: Install ocs
run: |
pip3 install -r requirements.txt
pip3 install -e .[so3g]
# Unit Tests
- name: Run unit tests
working-directory: ./tests
run: |
COVERAGE_FILE=.coverage.unit python3 -m pytest --cov -m 'not integtest'
# Integration Tests
- name: Build images for integration tests
run: |
docker compose build ocs ocs-crossbar
- name: Run integration tests
working-directory: ./tests
run: |
mkdir log
COVERAGE_FILE=.coverage.int python3 -m pytest --cov -m 'integtest'
ls -la ./log/
# Coverage
- name: Report test coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv ./tests/.coverage.* ./
pip install coveralls
coverage combine
coverage report
coveralls --service=github