-
Notifications
You must be signed in to change notification settings - Fork 17
80 lines (66 loc) · 2.42 KB
/
_tests.yaml
File metadata and controls
80 lines (66 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Tests
on:
# Runs when manually triggered from the GitHub UI.
workflow_dispatch:
# Runs when invoked by another workflow.
workflow_call:
permissions:
contents: read
jobs:
unit_tests:
name: Unit tests
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
with:
python_versions: '["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
tests_concurrency: "16"
# Integration tests are inlined (not 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.
integration_tests:
name: Integration tests (${{ matrix.python-version }}, ${{ matrix.os }})
if: >-
${{
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'apify') ||
(github.event_name == 'push' && github.ref == 'refs/heads/master') ||
github.event_name == 'workflow_dispatch'
}}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11", "3.14"]
runs-on: ${{ matrix.os }}
env:
TESTS_CONCURRENCY: "16"
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv package manager
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: uv run poe install-dev
- name: Run integration tests
run: uv run poe integration-tests-cov
env:
APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }}
APIFY_TEST_USER_2_API_TOKEN: ${{ secrets.APIFY_TEST_USER_2_API_TOKEN }}
- name: Upload integration test coverage
if: >-
${{
matrix.os == 'ubuntu-latest' &&
matrix.python-version == '3.14' &&
env.CODECOV_TOKEN != ''
}}
uses: codecov/codecov-action@v6
with:
token: ${{ env.CODECOV_TOKEN }}
files: coverage-integration.xml
flags: integration