|
4 | 4 | pull_request: |
5 | 5 |
|
6 | 6 | jobs: |
7 | | - lint: |
8 | | - runs-on: ubuntu-latest |
9 | | - strategy: |
10 | | - matrix: |
11 | | - python-version: ["3.10", "3.11"] |
12 | | - steps: |
13 | | - - uses: actions/checkout@v4 |
14 | | - - uses: actions/setup-python@v5 |
15 | | - with: |
16 | | - python-version: ${{ matrix.python-version }} |
17 | | - cache: "pip" |
18 | | - |
19 | | - - name: Upgrade pip |
20 | | - run: python -m pip install -U pip |
21 | | - |
22 | | - - name: Install project + dev extras |
23 | | - run: pip install ".[dev]" |
24 | | - |
25 | | - - name: Lint (pylint) |
26 | | - run: pylint biped_walking_controller || true # drop `|| true` if you want hard fail |
27 | | - |
28 | 7 | tests: |
29 | 8 | runs-on: ubuntu-latest |
30 | | - needs: lint |
31 | | - strategy: |
32 | | - matrix: |
33 | | - python-version: [ "3.10", "3.11" ] |
34 | 9 | steps: |
35 | 10 | - uses: actions/checkout@v4 |
36 | 11 | - uses: actions/setup-python@v5 |
37 | 12 | with: |
38 | | - python-version: ${{ matrix.python-version }} |
| 13 | + python-version: 3.11 |
39 | 14 | cache: pip |
| 15 | + |
40 | 16 | - name: Upgrade pip |
41 | 17 | run: python -m pip install -U pip |
| 18 | + |
42 | 19 | - name: Install project + test deps |
43 | | - run: pip install ".[dev]" pytest pytest-cov |
| 20 | + run: pip install -e ".[dev]" pytest pytest-cov |
| 21 | + |
44 | 22 | - name: Run tests with coverage |
45 | 23 | run: | |
46 | | - pytest -q \ |
47 | | - --cov=biped_walking_controller \ |
48 | | - --cov-report=term-missing \ |
49 | | - --cov-report=xml \ |
50 | | - --cov-report=html |
51 | | - - name: Upload HTML coverage |
52 | | - if: always() |
53 | | - uses: actions/upload-artifact@v4 |
54 | | - with: |
55 | | - name: coverage-html-${{ matrix.python-version }} |
56 | | - path: htmlcov |
57 | | - - name: Upload coverage XML |
58 | | - if: always() |
59 | | - uses: actions/upload-artifact@v4 |
60 | | - with: |
61 | | - name: coverage-xml-${{ matrix.python-version }} |
62 | | - path: coverage.xml |
63 | | - docs: |
64 | | - runs-on: ubuntu-latest |
65 | | - steps: |
66 | | - - uses: actions/checkout@v4 |
67 | | - - uses: actions/setup-python@v5 |
| 24 | + pytest --cov=biped_walking_controller --cov-report=xml --cov-report=term-missing:skip-covered |
| 25 | +
|
| 26 | + - name: Upload coverage to Codecov |
| 27 | + uses: codecov/codecov-action@v4 |
68 | 28 | with: |
69 | | - python-version: ${{ matrix.python-version }} |
70 | | - cache: pip |
71 | | - - name: Upgrade pip |
72 | | - run: python -m pip install -U pip |
73 | | - - name: Install project dependencies |
74 | | - run: pip install ".[docs]" |
75 | | - - name: Pull LFS files |
76 | | - run: git lfs fetch --all && git lfs checkout |
77 | | - - name: Build documentation |
78 | | - if: github.event_name == 'push' && github.ref != 'refs/heads/main' |
79 | | - run: mkdocs build |
80 | | - - name: Deploy documentation |
81 | | - if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
82 | | - run: mkdocs gh-deploy --force |
| 29 | + files: ./coverage.xml |
| 30 | + flags: unittests |
| 31 | + fail_ci_if_error: true |
| 32 | + |
0 commit comments