|
1 | 1 | name: Unit |
2 | | - |
3 | 2 | env: |
4 | 3 | PYTHON_MAIN_VERSION: 3.12 |
5 | | - |
6 | 4 | on: |
7 | 5 | workflow_call: |
8 | | - |
9 | 6 | jobs: |
10 | 7 | build: |
11 | 8 | runs-on: ${{ matrix.os }} |
12 | | - |
13 | 9 | strategy: |
14 | 10 | matrix: |
15 | 11 | os: [ubuntu-latest] |
16 | 12 | python-version: ["3.11", "3.12"] |
17 | | - |
18 | 13 | steps: |
19 | | - - uses: actions/checkout@v3 |
20 | | - |
| 14 | + - uses: actions/checkout@v4 |
21 | 15 | - name: Set up Python ${{ matrix.python-version }} |
22 | | - uses: actions/setup-python@v2 |
| 16 | + uses: actions/setup-python@v4 |
23 | 17 | with: |
24 | 18 | python-version: ${{ matrix.python-version }} |
25 | | - |
26 | 19 | - name: Install dependencies |
27 | 20 | run: | |
28 | 21 | bash scripts/install.sh |
29 | 22 | bash scripts/install.sh test |
30 | | -
|
31 | 23 | - name: Lint with flake8 |
32 | 24 | run: | |
33 | 25 | # stop the build if there are Python syntax errors or undefined names |
34 | 26 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
35 | 27 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
36 | 28 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
37 | | -
|
38 | 29 | - name: Run tests |
39 | 30 | run: | |
40 | | - pytest -v --cov --cov-report xml tests |
41 | | -
|
| 31 | + pytest -v --cov --cov-report=xml --cov-report=term tests |
42 | 32 | - name: Upload coverage to Codecov |
43 | 33 | if: ${{ matrix.python-version == env.PYTHON_MAIN_VERSION }} |
44 | | - uses: codecov/codecov-action@v1 |
| 34 | + uses: codecov/codecov-action@v4 |
45 | 35 | with: |
46 | 36 | token: ${{ secrets.CODECOV_TOKEN }} |
47 | | - files: ./coverage.xml |
48 | | - # directory: ./coverage/reports/ |
| 37 | + file: ./coverage.xml |
49 | 38 | flags: unittests |
50 | | - env_vars: OS,PYTHON |
51 | 39 | name: codecov-umbrella |
52 | 40 | fail_ci_if_error: true |
53 | | - # path_to_write_report: ./coverage/codecov_report.txt |
54 | 41 | verbose: true |
0 commit comments