Skip to content

Commit a8f0052

Browse files
authored
ci: update workflows and fix Python version reference (#291)
- fix python version reference - fix shared workflows reference - update path to shared workflows - use pull request for code checks - fix docs build
1 parent 97a3021 commit a8f0052

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

.github/workflows/build_and_deploy_docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- name: Install Python dependencies
5757
run: |
58-
pipx install --python ${{ matrix.python-version }} poetry
58+
pipx install --python ${{ env.PYTHON_VERSION }} poetry
5959
make install-dev
6060
6161
- name: Build generated API reference

.github/workflows/run_code_checks.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@ name: Run code checks
22

33
on:
44
# Trigger code checks on opening a new pull request.
5-
pull_request_target:
5+
# Secrets are only made available to the integration tests job, with a manual approval
6+
# step required for PRs from forks. This prevents their potential exposure.
7+
pull_request:
68

7-
# Do not trigger code checks on push to the master branch, as they will be triggered
8-
# by the release workflow.
9-
10-
# Trigger code checks on workflow call (e.g. from run release workflow).
11-
workflow_call:
9+
# Trigger code checks on pushing to the master branch.
10+
push:
11+
branches:
12+
- master
13+
tags-ignore:
14+
- "**"
1215

1316
jobs:
1417
lint_check:
1518
name: Lint check
16-
uses: apify/workflows/.github/workflows/python/lint_check.yaml
19+
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
1720

1821
type_check:
1922
name: Type check
20-
uses: apify/workflows/.github/workflows/python/type_check.yaml
23+
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
2124

2225
unit_tests:
2326
name: Unit tests
24-
uses: apify/workflows/.github/workflows/python/unit_tests.yaml
27+
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
2528

2629
# TODO: remove this once https://github.com/apify/apify-sdk-python/issues/241 is resolved
2730
changelog_entry_check:
@@ -35,9 +38,10 @@ jobs:
3538

3639
docs_check:
3740
name: Docs check
38-
uses: apify/workflows/.github/workflows/python/docs_check.yaml
41+
uses: apify/workflows/.github/workflows/python_docs_check.yaml@main
3942

4043
integration_tests:
4144
name: Integration tests
42-
uses: apify/workflows/.github/workflows/python/integration_tests.yaml
45+
needs: [lint_check, type_check, unit_tests]
46+
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
4347
secrets: inherit

.github/workflows/run_release.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
name: Run release
22

33
on:
4-
# Push to master will publish a beta version
4+
# Push to master will publish a beta version.
55
push:
66
branches:
77
- master
88
tags-ignore:
99
- "**"
10-
# A release via GitHub releases will publish a stable version
10+
11+
# A release via GitHub releases will publish a stable version.
1112
release:
1213
types: [published]
13-
# Workflow dispatch will publish whatever you choose
14+
15+
# Workflow dispatch will publish whatever you choose.
1416
workflow_dispatch:
1517
inputs:
1618
release_type:
@@ -37,17 +39,17 @@ jobs:
3739
lint_check:
3840
name: Lint check
3941
needs: [should_release]
40-
uses: apify/workflows/.github/workflows/python/lint_check.yaml
42+
uses: apify/workflows/.github/workflows/python_lint_check.yaml@main
4143

4244
type_check:
4345
name: Type check
4446
needs: [should_release]
45-
uses: apify/workflows/.github/workflows/python/type_check.yaml
47+
uses: apify/workflows/.github/workflows/python_type_check.yaml@main
4648

4749
unit_tests:
4850
name: Unit tests
4951
needs: [should_release]
50-
uses: apify/workflows/.github/workflows/python/unit_tests.yaml
52+
uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main
5153

5254
# TODO: remove this once https://github.com/apify/apify-sdk-python/issues/241 is resolved
5355
changelog_entry_check:
@@ -64,7 +66,7 @@ jobs:
6466
integration_tests:
6567
name: Integration tests
6668
needs: [should_release]
67-
uses: apify/workflows/.github/workflows/python/integration_tests.yaml
69+
uses: apify/workflows/.github/workflows/python_integration_tests.yaml@main
6870
secrets: inherit
6971

7072
publish_to_pypi:
@@ -98,7 +100,7 @@ jobs:
98100

99101
- name: Install Python dependencies
100102
run: |
101-
pipx install --python ${{ matrix.python-version }} poetry
103+
pipx install --python ${{ env.PYTHON_VERSION }} poetry
102104
make install-dev
103105
104106
- # Determine if this is a prerelease or latest release

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ build-api-reference:
5656
cd website && poetry run ./build_api_reference.sh
5757

5858
build-docs: build-api-reference
59-
cd website && yarn && yarn build
59+
cd website && npm clean-install && npm run build
6060

6161
run-docs: build-api-reference
6262
cd website && npm clean-install && npm run start

0 commit comments

Comments
 (0)