Skip to content

Commit b73ba94

Browse files
vdusekclaude
andauthored
ci: Fix integration tests failing on fork PRs (#655)
## Summary - Inline integration tests in the CI workflow instead of calling the reusable workflow to avoid GitHub's compile-time secret validation for nested reusable workflows, which fails on fork PRs where repo secrets are not available - Add `workflow_dispatch` to the integration tests condition - Remove unnecessary `secrets: inherit` from unit tests This follows the same pattern as in the Python SDK: https://github.com/apify/apify-sdk-python/blob/master/.github/workflows/_tests.yaml ## Test plan - [x] Verify the workflow syntax is valid - [x] Integration tests should run on PRs from the `apify` org, pushes to `master`, and manual triggers - [x] Integration tests should be skipped on fork PRs 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 46762eb commit b73ba94

File tree

1 file changed

+52
-11
lines changed

1 file changed

+52
-11
lines changed

.github/workflows/_tests.yaml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,67 @@ jobs:
1414
unit_tests:
1515
name: Unit tests
1616
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
17-
secrets: inherit
1817
with:
1918
python_versions: '["3.11", "3.12", "3.13", "3.14"]'
2019
operating_systems: '["ubuntu-latest", "windows-latest"]'
2120
python_version_for_codecov: "3.14"
2221
operating_system_for_codecov: ubuntu-latest
2322
tests_concurrency: "16"
2423

24+
# Integration tests are inlined (not calling the reusable workflow) to avoid GitHub's compile-time secret
25+
# validation for nested reusable workflows, which fails on fork PRs where repo secrets are not available.
2526
integration_tests:
26-
name: Integration tests
27+
name: Integration tests (${{ matrix.python-version }}, ${{ matrix.os }})
2728
if: >-
2829
${{
2930
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'apify') ||
30-
(github.event_name == 'push' && github.ref == 'refs/heads/master')
31+
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
32+
github.event_name == 'workflow_dispatch'
3133
}}
32-
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
33-
secrets: inherit
34-
with:
35-
python_versions: '["3.11", "3.14"]'
36-
operating_systems: '["ubuntu-latest"]'
37-
python_version_for_codecov: "3.14"
38-
operating_system_for_codecov: ubuntu-latest
39-
tests_concurrency: "16"
34+
35+
strategy:
36+
matrix:
37+
os: ["ubuntu-latest"]
38+
python-version: ["3.11", "3.14"]
39+
40+
runs-on: ${{ matrix.os }}
41+
42+
env:
43+
TESTS_CONCURRENCY: "16"
44+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v6
49+
50+
- name: Set up Python ${{ matrix.python-version }}
51+
uses: actions/setup-python@v6
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
55+
- name: Set up uv package manager
56+
uses: astral-sh/setup-uv@v7
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Install Python dependencies
61+
run: uv run poe install-dev
62+
63+
- name: Run integration tests
64+
run: uv run poe integration-tests-cov
65+
env:
66+
APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }}
67+
APIFY_TEST_USER_2_API_TOKEN: ${{ secrets.APIFY_TEST_USER_2_API_TOKEN }}
68+
69+
- name: Upload integration test coverage
70+
if: >-
71+
${{
72+
matrix.os == 'ubuntu-latest' &&
73+
matrix.python-version == '3.14' &&
74+
env.CODECOV_TOKEN != ''
75+
}}
76+
uses: codecov/codecov-action@v5
77+
with:
78+
token: ${{ env.CODECOV_TOKEN }}
79+
files: coverage-integration.xml
80+
flags: integration

0 commit comments

Comments
 (0)