-
Notifications
You must be signed in to change notification settings - Fork 530
62 lines (58 loc) · 1.99 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: pytest
on:
push:
branches: [master, dev-gha]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
extras: ["[diagrams]"]
include:
- python-version: "3.12"
extras: "[]"
- python-version: "3.12"
extras: "[diagrams,mypy]"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -U -r requirements_test.txt
- name: Install dependencies for diagrams
if: contains(matrix.extras, 'diagrams')
run: |
sudo apt-get install libgraphviz-dev graphviz
python -m pip install -r requirements.txt -r requirements_diagrams.txt
- name: Install dependencies for mypy
if: contains(matrix.extras, 'mypy')
run: |
python -c "print 'hello'" > /dev/null 2>&1 || pip install -r requirements_mypy.txt
- name: Test with pytest
run: |
coverage run -m pytest --doctest-modules tests/
coverage lcov --ignore-errors
- name: Coveralls Parallel
if: contains(matrix.extras, 'mypy')
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true