From ff36201a6fafe6191302ceb6ce4db6cf640b0992 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 11:46:02 +0100 Subject: [PATCH 1/5] chore: Add test coverage reports --- .github/workflows/pre_release.yaml | 13 ++++++++--- .github/workflows/release.yaml | 13 ----------- .github/workflows/run_code_checks.yaml | 15 +++++++++---- .gitignore | 2 ++ Makefile | 31 +++++++++++++++++++++----- README.md | 3 +++ 6 files changed, 51 insertions(+), 26 deletions(-) diff --git a/.github/workflows/pre_release.yaml b/.github/workflows/pre_release.yaml index 9dd47dd9..4f3db3ff 100644 --- a/.github/workflows/pre_release.yaml +++ b/.github/workflows/pre_release.yaml @@ -46,9 +46,13 @@ jobs: unit_tests: name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main + uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python + secrets: inherit with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + operating-systems: '["ubuntu-latest", "windows-latest"]' + python-version-for-codecov: "3.14" + operating-system-for-codecov: "ubuntu-latest" async_docstrings: name: Async dostrings check @@ -56,10 +60,13 @@ jobs: integration_tests: name: Integration tests - uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main + uses: apify/workflows/.github/workflows/python_integration_tests.yaml@add-code-cov-to-python secrets: inherit with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + python-versions: '["3.10", "3.14"]' + operating-systems: '["ubuntu-latest"]' + python-version-for-codecov: "3.14" + operating-system-for-codecov: "ubuntu-latest" update_changelog: name: Update changelog diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 41dafb10..ecdc007a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -55,23 +55,10 @@ jobs: with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - unit_tests: - name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - async_docstrings: name: Async dostrings check uses: ./.github/workflows/_async_docstrings_check.yaml - integration_tests: - name: Integration tests - uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main - secrets: inherit - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - update_changelog: name: Update changelog needs: [release_metadata, lint_check, type_check, unit_tests, integration_tests] diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index 6fa692b2..950312c3 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -26,9 +26,13 @@ jobs: unit_tests: name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main + uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python + secrets: inherit with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + operating-systems: '["ubuntu-latest", "windows-latest"]' + python-version-for-codecov: "3.14" + operating-system-for-codecov: "ubuntu-latest" async_docstrings: name: Async dostrings check @@ -41,7 +45,10 @@ jobs: integration_tests: name: Integration tests needs: [lint_check, type_check, unit_tests] - uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main - with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + uses: apify/workflows/.github/workflows/python_integration_tests.yaml@add-code-cov-to-python secrets: inherit + with: + python-versions: '["3.10", "3.14"]' + operating-systems: '["ubuntu-latest"]' + python-version-for-codecov: "3.14" + operating-system-for-codecov: "ubuntu-latest" diff --git a/.gitignore b/.gitignore index cfd8077f..6b3c714d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,8 @@ build/ # Coverage reports .coverage* htmlcov +coverage-unit.xml +coverage-integration.xml # IDE, editors .vscode diff --git a/Makefile b/Makefile index 0874e6d0..33975ded 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov \ - integration-tests format check-async-docstrings check-code fix-async-docstrings \ - build-api-reference build-docs run-docs +.PHONY: clean install-dev build publish-to-pypi lint type-check unit-tests unit-tests-cov integration-tests \ + integration-tests-cov format check-async-docstrings check-code fix-async-docstrings build-api-reference \ + build-docs run-docs # This is default for local testing, but GitHub workflows override it to a higher value in CI INTEGRATION_TESTS_CONCURRENCY = 1 @@ -27,13 +27,32 @@ type-check: uv run mypy unit-tests: - uv run pytest --numprocesses=auto --verbose --cov=src/apify_client tests/unit + uv run pytest \ + --numprocesses=auto \ + --verbose \ + tests/unit unit-tests-cov: - uv run pytest --numprocesses=auto --verbose --cov=src/apify_client --cov-report=html tests/unit + uv run pytest \ + --numprocesses=auto \ + --verbose \ + --cov=src/apify_client \ + --cov-report=xml:coverage-unit.xml \ + tests/unit integration-tests: - uv run pytest --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) --verbose tests/integration + uv run pytest \ + --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) \ + --verbose \ + tests/integration + +integration-tests-cov: + uv run pytest \ + --numprocesses=$(INTEGRATION_TESTS_CONCURRENCY) \ + --verbose \ + --cov=src/apify_client \ + --cov-report=xml:coverage-integration.xml \ + tests/integration format: uv run ruff check --fix diff --git a/README.md b/README.md index bdf89872..5a9ccf19 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ PyPI - Downloads + + Code cov report + PyPI - Python version From bafbea4f76ccd66b500f0e90935de9d5f3be4663 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 11:51:16 +0100 Subject: [PATCH 2/5] Add badge token --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a9ccf19..bb34dbcc 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ PyPI - Downloads - Code cov report + Code cov report PyPI - Python version From 29e8e5ffbc89e6f169a71277f80abdc5a301a62f Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 13:28:43 +0100 Subject: [PATCH 3/5] Add actions lint check --- .github/workflows/pre_release.yaml | 13 +++++++++++-- .github/workflows/run_code_checks.yaml | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre_release.yaml b/.github/workflows/pre_release.yaml index 4f3db3ff..c22d61c8 100644 --- a/.github/workflows/pre_release.yaml +++ b/.github/workflows/pre_release.yaml @@ -32,6 +32,15 @@ jobs: release_type: prerelease existing_changelog_path: CHANGELOG.md + actions_lint_check: + name: Actions lint check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Run actionlint + uses: rhysd/actionlint@v1.7.9 + lint_check: name: Lint check uses: apify/workflows/.github/workflows/python_lint_check.yaml@main @@ -52,7 +61,7 @@ jobs: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' operating-systems: '["ubuntu-latest", "windows-latest"]' python-version-for-codecov: "3.14" - operating-system-for-codecov: "ubuntu-latest" + operating-system-for-codecov: ubuntu-latest async_docstrings: name: Async dostrings check @@ -66,7 +75,7 @@ jobs: python-versions: '["3.10", "3.14"]' operating-systems: '["ubuntu-latest"]' python-version-for-codecov: "3.14" - operating-system-for-codecov: "ubuntu-latest" + operating-system-for-codecov: ubuntu-latest update_changelog: name: Update changelog diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index 950312c3..ebb15f59 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -12,6 +12,15 @@ on: workflow_dispatch: jobs: + actions_lint_check: + name: Actions lint check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Run actionlint + uses: rhysd/actionlint@v1.7.9 + lint_check: name: Lint check uses: apify/workflows/.github/workflows/python_lint_check.yaml@main @@ -32,7 +41,7 @@ jobs: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' operating-systems: '["ubuntu-latest", "windows-latest"]' python-version-for-codecov: "3.14" - operating-system-for-codecov: "ubuntu-latest" + operating-system-for-codecov: ubuntu-latest async_docstrings: name: Async dostrings check @@ -51,4 +60,4 @@ jobs: python-versions: '["3.10", "3.14"]' operating-systems: '["ubuntu-latest"]' python-version-for-codecov: "3.14" - operating-system-for-codecov: "ubuntu-latest" + operating-system-for-codecov: ubuntu-latest From 153ad243e57295c8b4592180239074f829efc8a3 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 13:31:24 +0100 Subject: [PATCH 4/5] Fix release workflow --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ecdc007a..4216e775 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -61,7 +61,7 @@ jobs: update_changelog: name: Update changelog - needs: [release_metadata, lint_check, type_check, unit_tests, integration_tests] + needs: [release_metadata, lint_check, type_check] uses: apify/workflows/.github/workflows/python_bump_and_update_changelog.yaml@main with: version_number: ${{ needs.release_metadata.outputs.version_number }} From 0a82a3efab0b844eedd502e1fe9453eec99bc33b Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 12 Dec 2025 13:42:29 +0100 Subject: [PATCH 5/5] Switch to main branch --- .github/workflows/pre_release.yaml | 4 ++-- .github/workflows/run_code_checks.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre_release.yaml b/.github/workflows/pre_release.yaml index c22d61c8..40def076 100644 --- a/.github/workflows/pre_release.yaml +++ b/.github/workflows/pre_release.yaml @@ -55,7 +55,7 @@ jobs: unit_tests: name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python + uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main secrets: inherit with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' @@ -69,7 +69,7 @@ jobs: integration_tests: name: Integration tests - uses: apify/workflows/.github/workflows/python_integration_tests.yaml@add-code-cov-to-python + uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main secrets: inherit with: python-versions: '["3.10", "3.14"]' diff --git a/.github/workflows/run_code_checks.yaml b/.github/workflows/run_code_checks.yaml index ebb15f59..051446c3 100644 --- a/.github/workflows/run_code_checks.yaml +++ b/.github/workflows/run_code_checks.yaml @@ -35,7 +35,7 @@ jobs: unit_tests: name: Unit tests - uses: apify/workflows/.github/workflows/python_unit_tests.yaml@add-code-cov-to-python + uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main secrets: inherit with: python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' @@ -54,7 +54,7 @@ jobs: integration_tests: name: Integration tests needs: [lint_check, type_check, unit_tests] - uses: apify/workflows/.github/workflows/python_integration_tests.yaml@add-code-cov-to-python + uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main secrets: inherit with: python-versions: '["3.10", "3.14"]'