-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Docs check | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
docs_check: | ||
name: Docs check | ||
runs-on: ubuntu-latest | ||
env: | ||
NODE_VERSION: 20 | ||
PYTHON_VERSION: 3.12 | ||
|
||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Enable corepack | ||
run: | | ||
corepack enable | ||
corepack prepare yarn@stable --activate | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pipx install --python ${{ env.PYTHON_VERSION }} poetry | ||
make install-dev | ||
- name: Build API reference | ||
run: make build-api-reference | ||
|
||
- name: Build docs website | ||
run: make build-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Integration tests | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
APIFY_TEST_USER_PYTHON_SDK_API_TOKEN: | ||
description: API token of the Python testing user on Apify | ||
required: true | ||
|
||
# Concurrency control to ensure only one instance of this workflow runs at a time. | ||
# This avoids exceeding API usage limits on the test user account. | ||
concurrency: | ||
group: integration_tests | ||
|
||
jobs: | ||
# Job to run integration tests from the main repository. | ||
integration_tests_on_main: | ||
name: Integration tests (main repository) | ||
runs-on: ubuntu-latest | ||
# If PR is from the main repository or it is a push to master. | ||
if: github.event.pull_request.head.repo.owner.login == 'apify' || github.ref == 'refs/heads/master' | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.12"] # Oldest and newest supported Python versions. | ||
max-parallel: 1 # No parallel tests to avoid exceeding API limits. | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pipx install --python ${{ matrix.python-version }} poetry | ||
make install-dev | ||
- name: Run integration tests | ||
run: make INTEGRATION_TESTS_CONCURRENCY=8 integration-tests | ||
env: | ||
APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }} | ||
|
||
# Job to request approval before running integration tests for PRs from forks. | ||
integration_tests_on_fork_approval: | ||
name: Approve integration tests for fork PR | ||
runs-on: ubuntu-latest | ||
# If the PR is from a fork. | ||
if: github.event.pull_request.head.repo.owner.login != 'apify' | ||
environment: | ||
name: fork-pr-integration-tests | ||
url: ${{ github.event.pull_request.html_url }} | ||
steps: | ||
- name: Await approval | ||
run: echo "Waiting for approval to run integration tests for fork PR." | ||
|
||
# Job to run integration tests for PRs from forks, only after manual approval. | ||
integration_tests_on_fork: | ||
name: Integration tests (fork after approval) | ||
needs: integration_tests_on_fork_approval | ||
# If the PR is from a fork. | ||
if: github.event.pull_request.head.repo.owner.login != 'apify' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.12"] # Oldest and newest supported Python versions. | ||
max-parallel: 1 # No parallel tests to avoid overshooting limits. | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pipx install --python ${{ matrix.python-version }} poetry | ||
make install-dev | ||
- name: Run integration tests | ||
run: make INTEGRATION_TESTS_CONCURRENCY=8 integration-tests | ||
env: | ||
APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Lint check | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint_check: | ||
name: Lint check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pipx install --python ${{ matrix.python-version }} poetry | ||
make install-dev | ||
- name: Run lint check | ||
run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Type check | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
type_check: | ||
name: Type check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pipx install --python ${{ matrix.python-version }} poetry | ||
make install-dev | ||
- name: Run type check | ||
run: make type-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Unit tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
unit_tests: | ||
name: Unit tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pipx install --python ${{ matrix.python-version }} poetry | ||
make install-dev | ||
- name: Run unit tests | ||
run: make unit-tests |