File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Run Tests
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ push :
8+ branches :
9+ - main
10+
11+ jobs :
12+ test :
13+ runs-on : ${{ matrix.os }}
14+ strategy :
15+ matrix :
16+ os : [ubuntu-latest, macos-latest]
17+ python-version : ['3.9', '3.10', '3.11', '3.12']
18+ fail-fast : false
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ - name : Set up Python ${{ matrix.python-version }}
25+ uses : actions/setup-python@v5
26+ with :
27+ python-version : ${{ matrix.python-version }}
28+ cache : ' pip'
29+
30+ - name : Install dependencies
31+ run : |
32+ python -m pip install --upgrade pip
33+ pip install pytest
34+
35+ - name : Run tests
36+ run : |
37+ pytest tests/ -v
38+
39+ - name : Run tests with coverage
40+ if : matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
41+ run : |
42+ pip install pytest-cov
43+ pytest tests/ --cov=. --cov-report=xml --cov-report=term
44+
45+ - name : Upload coverage reports
46+ if : success() && matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
47+ uses : codecov/codecov-action@v4
48+ with :
49+ file : ./coverage.xml
50+ fail_ci_if_error : false
51+ continue-on-error : true
You can’t perform that action at this time.
0 commit comments