diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..3d8e566008 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,6 @@ +codecov: + branch: dev + +comment: + require_head: false + require_base: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d7b8caf8a..6f7be26169 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: permissions: contents: read packages: read + id-token: write jobs: ci-complete: @@ -43,26 +44,27 @@ jobs: find .venv/lib/*/site-packages/pydrake -name '*.pyi' -delete 2>/dev/null || true - name: Run tests - if: github.event_name != 'push' run: | - /entrypoint.sh bash -c "source .venv/bin/activate && pytest --durations=0 -m 'not (tool or mujoco)'" - - - name: Run tests with coverage - if: github.event_name == 'push' - run: | - /entrypoint.sh bash -c "source .venv/bin/activate && _DIMOS_COV=1 coverage run -m pytest --durations=0 -m 'not (tool or mujoco)' && coverage combine && coverage html && coverage report" + /entrypoint.sh bash -c "source .venv/bin/activate && _DIMOS_COV=1 coverage run -m pytest --junitxml=junit.xml --durations=0 -m 'not (tool or mujoco)' && coverage combine && coverage xml" - name: Run mypy if: ${{ !cancelled() }} run: | /entrypoint.sh bash -c "source .venv/bin/activate && MYPYPATH=/opt/ros/humble/lib/python3.10/site-packages mypy dimos" - - name: Upload coverage report - if: github.event_name == 'push' && !cancelled() - uses: actions/upload-artifact@v5 + - name: Upload coverage + uses: codecov/codecov-action@v6 + with: + disable_search: true + fail_ci_if_error: true + files: ./coverage.xml + use_oidc: true + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/codecov-action@v6 with: - name: coverage-report - path: htmlcov/ + report_type: test_results + use_oidc: true - name: Check disk space if: failure() diff --git a/pyproject.toml b/pyproject.toml index 074670cb60..452ede3943 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -455,14 +455,20 @@ asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "function" [tool.coverage.run] +branch = true source = ["dimos"] parallel = true sigterm = true concurrency = ["multiprocessing", "thread"] [tool.coverage.report] -show_missing = true -skip_empty = true +exclude_also = [ + 'if TYPE_CHECKING', + 'assert False', + ': \.\.\.(\s*#.*)?$', + '^ +\.\.\.$', + 'pytest.fail\(' +] [tool.largefiles] max_size_kb = 50