From 274346144d960aa9f39fdc8aa716498ee6734ee9 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Tue, 27 Jan 2026 02:53:06 +0000 Subject: [PATCH 1/6] fix: test ci --- .github/workflows/test.yml | 31 +++++++++---------------------- .vscode/cspell.json | 2 +- noxfile.py | 8 ++++---- 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 606ba3c3..a4793082 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,8 +33,7 @@ jobs: runs-on: ubuntu-latest permissions: - contents: write - pull-requests: write + contents: read steps: - name: Checkout @@ -45,25 +44,13 @@ jobs: - name: Run pytest run: | - set -o pipefail - uv run nox -s test -- --junitxml pytest.xml | tee pytest-coverage.txt + uv run nox -s test -- --cov_report=xml - - name: Pytest coverage comment - uses: MishaKav/pytest-coverage-comment@v1 + - name: Upload results to Codecov + uses: codecov/codecov-action@v5 with: - pytest-coverage-path: ./pytest-coverage.txt - junitxml-path: ./pytest.xml - - - name: Creating coverage folder - run: mkdir -p coverage - - - name: Coverage Badge - uses: tj-actions/coverage-badge-py@v2 - with: - output: coverage/coverage.svg - - - name: Publish coverage report to coverage-badge branch - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: coverage-badge - folder: coverage + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 8ec5de8d..032c48ad 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -42,7 +42,6 @@ "ipython", "isort", "jaxtyping", - "junitxml", "kevinrose", "kwargs", "levelname", @@ -108,6 +107,7 @@ "toolsai", "typer", "uline", + "unittests", "usecases", "usefixtures", "usermod", diff --git a/noxfile.py b/noxfile.py index e0da3be4..a16ef632 100644 --- a/noxfile.py +++ b/noxfile.py @@ -13,7 +13,7 @@ class CLIArgs( ): """CLIArgs is a class that extends BaseSettings to handle command line arguments.""" - junitxml: str = "" + cov_report: str = "" ruff: bool = False sqlfluff: bool = False ty: bool = False @@ -101,9 +101,9 @@ def test(session: nox.Session) -> None: """ args = CLIArgs.parse(session.posargs) - command = ["uv", "run", "pytest"] - if args.junitxml: - command.append(f"--junitxml={args.junitxml}") + command = ["uv", "run", "pytest", "--cov", "--cov-branch"] + if args.cov_report: + command.append(f"--cov-report={args.cov_report}") session.run(*command) From 76259863f09e653e4d56db91922ba3bf8ac23051 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Tue, 27 Jan 2026 02:55:39 +0000 Subject: [PATCH 2/6] update: docs --- CLAUDE.md | 2 +- README.md | 24 ++++++++++++------------ docs/guides/index.md | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 69de42a9..9199c453 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,7 +34,7 @@ uv run nox -s test uv run pytest tests/tools/test__logger.py # Run with JUnit XML output for CI -uv run nox -s test -- --junitxml=results.xml +uv run nox -s test -- uv run nox -s test -- --cov_report=xml # Run pytest directly (bypasses nox) uv run pytest diff --git a/README.md b/README.md index 519cc855..5c333629 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ uv run nox -s lint -- --ruff uv run nox -s test # Run tests with JUnit XML output (for CI) -uv run nox -s test -- --junitxml=results.xml +uv run nox -s test -- --cov_report=xml ``` You can also run tools directly: @@ -338,17 +338,17 @@ Automated workflows ensure code quality and consistency. All workflows run on pu **Available workflows in `.github/workflows/`:** -| Workflow | Purpose | Tools Used | -|----------|---------|-----------| -| `docker.yml` | Validate Docker build | Docker | -| `devcontainer.yml` | Validate Dev Container configuration | devcontainer CLI | -| `format.yml` | Check code formatting | Ruff | -| `labeler.yml` | Add label in GitHub | GitHub | -| `lint.yml` | Run static analysis | Ruff, ty | -| `test.yml` | Run test suite with coverage | pytest, coverage | -| `gh-deploy.yml` | Deploy documentation to GitHub Pages | MkDocs | -| `pr-agent.yml` | Automated PR reviews | Qodo AI PR Agent | -| `publish-devcontainer.yml` | Publish Dev Container image | Docker, GHCR | +| Workflow | Purpose | Tools Used | +| -------------------------- | ------------------------------------ | ---------------- | +| `docker.yml` | Validate Docker build | Docker | +| `devcontainer.yml` | Validate Dev Container configuration | devcontainer CLI | +| `format.yml` | Check code formatting | Ruff | +| `labeler.yml` | Add label in GitHub | GitHub | +| `lint.yml` | Run static analysis | Ruff, ty | +| `test.yml` | Run test suite with coverage | pytest, coverage | +| `gh-deploy.yml` | Deploy documentation to GitHub Pages | MkDocs | +| `pr-agent.yml` | Automated PR reviews | Qodo AI PR Agent | +| `publish-devcontainer.yml` | Publish Dev Container image | Docker, GHCR | ## 🎨 VSCode Configuration diff --git a/docs/guides/index.md b/docs/guides/index.md index cafe22f2..f250c53b 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -39,7 +39,7 @@ uv run nox -s lint -- --ty # ty only uv run nox -s test # Run tests with JUnit XML output (for CI) -uv run nox -s test -- --junitxml=results.xml +uv run nox -s test -- --cov_report=xml ``` ### Why nox? From 6c50bc0c92b033c4a0c0a4d559d4e08d1d2f3f76 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Tue, 27 Jan 2026 02:59:12 +0000 Subject: [PATCH 3/6] fix: workflow files --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4793082..94f5d098 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: - name: Run pytest run: | - uv run nox -s test -- --cov_report=xml + uv run nox -s test -- --cov_report xml - name: Upload results to Codecov uses: codecov/codecov-action@v5 From c3a4dd74073a486ac695d629968a30bbfda99d00 Mon Sep 17 00:00:00 2001 From: a5chin <81167661+a5chin@users.noreply.github.com> Date: Tue, 27 Jan 2026 12:20:40 +0900 Subject: [PATCH 4/6] Update CLAUDE.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9199c453..af067fd9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -34,7 +34,7 @@ uv run nox -s test uv run pytest tests/tools/test__logger.py # Run with JUnit XML output for CI -uv run nox -s test -- uv run nox -s test -- --cov_report=xml +uv run nox -s test -- --cov_report=xml # Run pytest directly (bypasses nox) uv run pytest From c334cf7855bcc6751668870fa1f523560fdd1461 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Tue, 27 Jan 2026 12:23:47 +0900 Subject: [PATCH 5/6] update: README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c333629..2d378b15 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [![Docker](https://github.com/a5chin/python-uv/actions/workflows/docker.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/docker.yml) [![Format](https://github.com/a5chin/python-uv/actions/workflows/format.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/format.yml) [![Lint](https://github.com/a5chin/python-uv/actions/workflows/lint.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/lint.yml) -[![Test](https://github.com/a5chin/python-uv/actions/workflows/test.yml/badge.svg)](https://github.com/a5chin/python-uv/actions/workflows/test.yml) +[![codecov](https://codecov.io/github/a5chin/python-uv/graph/badge.svg?token=M9JIB8T6R4)](https://codecov.io/github/a5chin/python-uv) From 1b0ae4dcf2402c6ed85e62b7395a43ace35c8e15 Mon Sep 17 00:00:00 2001 From: d-eigo-hara Date: Tue, 27 Jan 2026 13:37:47 +0900 Subject: [PATCH 6/6] add: codecov.yaml --- codecov.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 codecov.yaml diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..d9e0bd58 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,29 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "50...75" + + status: + project: + default: + target: auto + threshold: 0% + if_ci_failed: error + patch: + default: + target: 75% + +comment: + layout: "reach, diff, flags, files, header, footer" + behavior: default + require_changes: false + require_head: false + require_base: false + +ignore: + - "tests/*" + - "noxfile.py" + - "**/__init__.py"