Skip to content

Commit dca437e

Browse files
vdusekclaude
andcommitted
ci: Consolidate check workflows into a single Checks workflow
Merge _check_code.yaml, _check_package.yaml, and _tests.yaml into a single _checks.yaml that exposes each check as a job. Reduces duplication across on_master.yaml and on_pull_request.yaml and gives every check the shared `Checks /` prefix. unit_tests carries `if: inputs.run_tests` so on_master.yaml can keep skipping tests for "ci" and "docs" commits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dc15e81 commit dca437e

6 files changed

Lines changed: 102 additions & 114 deletions

File tree

.github/workflows/_check_code.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/_check_package.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/_checks.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Checks
2+
3+
on:
4+
# Runs when manually triggered from the GitHub UI.
5+
workflow_dispatch:
6+
inputs:
7+
run_tests:
8+
description: Whether to run the unit test suite.
9+
required: false
10+
type: boolean
11+
default: true
12+
13+
# Runs when invoked by another workflow.
14+
workflow_call:
15+
inputs:
16+
run_tests:
17+
description: Whether to run the unit test suite.
18+
required: false
19+
type: boolean
20+
default: true
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
actions_lint_check:
27+
name: Actions lint check
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v6
32+
- name: Run actionlint
33+
uses: rhysd/actionlint@v1.7.9
34+
35+
spell_check:
36+
name: Spell check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v6
41+
- name: Check spelling with typos
42+
uses: crate-ci/typos@v1
43+
44+
lint_check:
45+
name: Lint check
46+
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
47+
with:
48+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
49+
50+
type_check:
51+
name: Type check
52+
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
53+
with:
54+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
55+
56+
unit_tests:
57+
name: Unit tests
58+
if: inputs.run_tests
59+
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
60+
with:
61+
python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
62+
operating_systems: '["ubuntu-latest", "windows-latest"]'
63+
tests_concurrency: "1"
64+
# Codecov inputs omitted - apify-shared-python doesn't use codecov.
65+
66+
package_check:
67+
name: Package check
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout repository
71+
uses: actions/checkout@v6
72+
73+
- name: Set up uv package manager
74+
uses: astral-sh/setup-uv@v8.1.0
75+
with:
76+
python-version: "3.14"
77+
78+
- name: Build sdist and wheel
79+
run: uv run poe build
80+
81+
- name: Verify built package
82+
uses: apify/actions/python-package-check@v1.1.0
83+
with:
84+
package_name: apify_shared
85+
dist_dir: dist
86+
python_version: "3.14"
87+
smoke_code: |
88+
from apify_shared.consts import WebhookEventType

.github/workflows/_tests.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/on_master.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ on:
88
- "**" # Ignore all tags to avoid duplicate executions triggered by tag pushes.
99

1010
jobs:
11-
code_checks:
12-
name: Code checks
13-
uses: ./.github/workflows/_check_code.yaml
14-
15-
tests:
16-
# Skip this for "ci" and "docs" commits.
17-
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs')"
18-
name: Tests
19-
uses: ./.github/workflows/_tests.yaml
11+
checks:
12+
name: Checks
13+
uses: ./.github/workflows/_checks.yaml
14+
with:
15+
# Skip the test suite for "ci" and "docs" commits — they don't change runtime behavior.
16+
run_tests: >-
17+
${{
18+
!startsWith(github.event.head_commit.message, 'ci') &&
19+
!startsWith(github.event.head_commit.message, 'docs')
20+
}}
2021
2122
# The beta release is dispatched as a separate workflow run (instead of calling `manual_release_beta.yaml` via `uses:`)
2223
# because PyPI's Trusted Publishing does not currently support reusable workflows.
@@ -25,7 +26,7 @@ jobs:
2526
# Skip this for "ci", "docs" and "test" commits and for forks.
2627
if: "!startsWith(github.event.head_commit.message, 'ci') && !startsWith(github.event.head_commit.message, 'docs') && !startsWith(github.event.head_commit.message, 'test') && startsWith(github.repository, 'apify/')"
2728
name: Beta release
28-
needs: [code_checks, tests]
29+
needs: [checks]
2930
runs-on: ubuntu-latest
3031
permissions:
3132
actions: write # Required by execute-workflow.

.github/workflows/on_pull_request.yaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ jobs:
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515

16-
code_checks:
17-
name: Code checks
18-
uses: ./.github/workflows/_check_code.yaml
19-
20-
package_check:
21-
name: Package check
22-
uses: ./.github/workflows/_check_package.yaml
23-
24-
tests:
25-
name: Tests
26-
uses: ./.github/workflows/_tests.yaml
16+
checks:
17+
name: Checks
18+
uses: ./.github/workflows/_checks.yaml

0 commit comments

Comments
 (0)