Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runner input for all callable workflows #280

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
default: main

# General - OPTIONAL
runner:
description: "The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system."
required: false
type: string
default: ubuntu-latest
install_extras:
description: "Any extras to install from the local repository through 'pip'. Must be encapsulated in square parentheses (`[]`) and be separated by commas (`,`) without any spaces. Example: `'[dev,release]'`."
required: false
Expand Down Expand Up @@ -175,7 +180,7 @@ jobs:
update-and-publish:
name: Update CHANGELOG and version and publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Validate inputs
Expand Down Expand Up @@ -370,7 +375,7 @@ jobs:
docs:
name: Deploy release documentation
needs: update-and-publish
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
if: inputs.update_docs

permissions:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci_automerge_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: CI - Activate auto-merging for PRs
on:
workflow_call:
inputs:
runner:
description: "The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system."
required: false
type: string
default: ubuntu-latest
perform_changes:
description: "Whether or not to perform and commit changes to the PR branch prior to activating auto-merge."
required: false
Expand Down Expand Up @@ -30,7 +35,7 @@ jobs:
activate-auto-merge:
name: Activate auto-merging for PR
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Checkout ${{ github.repository }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/ci_cd_updated_default_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
type: string

# General - OPTIONAL
runner:
description: "The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system."
required: false
type: string
default: ubuntu-latest
default_repo_branch:
description: "The branch name of the repository's default branch. More specifically, the branch that triggered this workflow."
required: false
Expand Down Expand Up @@ -169,7 +174,7 @@ on:
jobs:
deploy_docs:
name: Deploy `latest` documentation
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
if: inputs.update_docs

permissions:
Expand Down Expand Up @@ -457,7 +462,7 @@ jobs:

update-dependencies-branch:
name: Update permanent dependencies branch
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
needs: deploy_docs
if: always() && inputs.update_dependencies_branch

Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci_check_pyproject_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI - Check pyproject.toml dependencies
on:
workflow_call:
inputs:
# REQUIRED
git_username:
description: "A git username (used to set the 'user.name' config option)."
required: true
Expand All @@ -11,6 +12,13 @@ on:
description: "A git user's email address (used to set the 'user.email' config option)."
required: true
type: string

# OPTIONAL
runner:
description: "The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system."
required: false
type: string
default: ubuntu-latest
target_branch:
description: "The branch name for the target of the opened PR."
required: false
Expand Down Expand Up @@ -84,7 +92,7 @@ on:
jobs:
check-dependencies:
name: Check & update dependencies in `pyproject.toml`
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Validate inputs
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
workflow_call:
inputs:
# General
runner:
description: "The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system."
required: false
type: string
default: ubuntu-latest
install_extras:
description: "Any extras to install from the local repository through 'pip'. Must be encapsulated in square parentheses (`[]`) and be separated by commas (`,`) without any spaces. Example: `'[dev,pre-commit]'`."
required: false
Expand Down Expand Up @@ -243,7 +248,7 @@ jobs:
pre-commit:
name: Run `pre-commit`
if: inputs.run_pre-commit
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Checkout ${{ github.repository }}
Expand All @@ -270,7 +275,7 @@ jobs:
pylint_and_safety:
name: Run `pylint` & `safety`
if: inputs.run_pylint || inputs.run_safety
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Checkout ${{ github.repository }}
Expand Down Expand Up @@ -344,7 +349,7 @@ jobs:
build-package:
name: Build distribution package
if: inputs.run_build_package
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Checkout ${{ github.repository }}
Expand Down Expand Up @@ -373,7 +378,7 @@ jobs:
docs:
name: Build Documentation
if: inputs.run_build_docs
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Determine framework
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci_update_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI - Update dependencies PR
on:
workflow_call:
inputs:
# REQUIRED
git_username:
description: "A git username (used to set the 'user.name' config option)."
required: true
Expand All @@ -11,6 +12,13 @@ on:
description: "A git user's email address (used to set the 'user.email' config option)."
required: true
type: string

# OPTIONAL
runner:
description: "The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system."
required: false
type: string
default: ubuntu-latest
permanent_dependencies_branch:
description: "The branch name for the permanent dependency updates branch."
required: false
Expand Down Expand Up @@ -74,7 +82,7 @@ on:
jobs:
create-collected-pr:
name: Single dependabot PR
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}

steps:
- name: Checkout ${{ github.repository }}
Expand Down
1 change: 1 addition & 0 deletions docs/workflows/cd_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ The following inputs are general inputs for the workflow as a whole.
| `git_username` | A git username (used to set the 'user.name' config option). | **_Yes_** | | _string_ |
| `git_email` | A git user's email address (used to set the 'user.email' config option). | **_Yes_** | | _string_ |
| `release_branch` | The branch name to release/publish from. | **_Yes_** | main | _string_ |
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `install_extras` | Any extras to install from the local repository through 'pip'. Must be encapsulated in square parentheses (`[]`) and be separated by commas (`,`) without any spaces.</br></br>Example: `'[dev,release]'`. | No | _Empty string_ | _string_ |
| `relative` | Whether or not to use install the local Python package(s) as an editable. | No | `false` | _boolean_ |
| `test` | Whether to use the TestPyPI repository index instead of PyPI as well as output debug statements in both workflow jobs. | No | `false` | _boolean_ |
Expand Down
1 change: 1 addition & 0 deletions docs/workflows/ci_automerge_prs.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This workflow can _only_ be called if the triggering event from the caller workf

| **Name** | **Description** | **Required** | **Default** | **Type** |
|:--- |:--- |:---:|:---:|:---:|
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `perform_changes` | Whether or not to perform and commit changes to the PR branch prior to activating auto-merge. | No | | _boolean_ |
| `git_username` | A git username (used to set the 'user.name' config option).</br>**Required** if `perform_changes` is 'true'. | No | | _string_ |
| `git_email` | A git user's email address (used to set the 'user.email' config option).</br>**Required** if `perform_changes` is 'true'. | No | | _string_ |
Expand Down
1 change: 1 addition & 0 deletions docs/workflows/ci_cd_updated_default_branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The following inputs are general inputs for the workflow as a whole.
|:--- |:--- |:---:|:---:|:---:|
| `git_username` | A git username (used to set the 'user.name' config option). | **_Yes_** | | _string_ |
| `git_email` | A git user's email address (used to set the 'user.email' config option). | **_Yes_** | | _string_ |
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `default_repo_branch` | The branch name of the repository's default branch. More specifically, the branch the PR should target. | No | main | _string_ |
| `test` | Whether to do a "dry run", i.e., run the workflow, but avoid pushing to 'permanent_dependencies_branch' branch and deploying documentation (if 'update_docs' is 'true'). | No | `false` | _boolean_ |
| `pip_index_url` | A URL to a PyPI repository index. | No | `https://pypi.org/simple/` | _string_ |
Expand Down
1 change: 1 addition & 0 deletions docs/workflows/ci_check_pyproject_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The repository contains the following:
|:--- |:--- |:---:|:---:|:---:|
| `git_username` | A git username (used to set the 'user.name' config option). | **_Yes_** | | _string_ |
| `git_email` | A git user's email address (used to set the 'user.email' config option). | **_Yes_** | | _string_ |
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `target_branch` | The branch name for the target of the opened PR.</br></br>**Note**: If a value is not given for this nor `permanent_dependencies_branch`, the default value for `permanent_dependencies_branch` will be used until v2.6.0, whereafter providing an explicit value for `target_branch` is **required**. | No | _Empty string_ | _string_ |
| `permanent_dependencies_branch` | **DEPRECATED** - Will be removed in v2.6.0. Use `target_branch` instead.</br></br>The branch name for the permanent dependency updates branch. | No | ci/dependency-updates | _string_ |
| `python_version` | The Python version to use for the workflow. | No | 3.9 | _string_ |
Expand Down
2 changes: 2 additions & 0 deletions docs/workflows/ci_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ These inputs are general and apply to all jobs in this workflow.

| **Name** | **Description** | **Required** | **Default** | **Type** |
|:--- |:--- |:---:|:---:|:---:|
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `install_extras` | Any extras to install from the local repository through 'pip'. Must be encapsulated in square parentheses (`[]`) and be separated by commas (`,`) without any spaces.</br></br>Example: `'[dev,pre-commit]'`. | No | _Empty string_ | _string_ |

### Run `pre-commit`
Expand Down Expand Up @@ -228,6 +229,7 @@ See also [General information](index.md#general-information).

| **Name** | **Description** | **Required** | **Default** | **Type** |
|:--- |:--- |:---:|:---:|:---:|
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `install_extras` | Any extras to install from the local repository through 'pip'. Must be encapsulated in square parentheses (`[]`) and be separated by commas (`,`) without any spaces.</br></br>Example: `'[dev,pre-commit]'`. | No | _Empty string_ | _string_ |
| `run_pre-commit` | Run the `pre-commit` test job. | No | `true` | _boolean_ |
| `python_version_pre-commit` | The Python version to use for the `pre-commit` test job. | No | 3.9 | _string_ |
Expand Down
1 change: 1 addition & 0 deletions docs/workflows/ci_update_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ There are no expectations of the repo when using this workflow.
|:--- |:--- |:---:|:---:|:---:|
| `git_username` | A git username (used to set the 'user.name' config option). | **_Yes_** | | _string_ |
| `git_email` | A git user's email address (used to set the 'user.email' config option). | **_Yes_** | | _string_ |
| `runner` | The runner to use for the workflow. Note, the callable workflow expects a Linux/Unix system.. | No | ubuntu-latest | _string_ |
| `permanent_dependencies_branch` | The branch name for the permanent dependency updates branch. | No | ci/dependency-updates | _string_ |
| `default_repo_branch` | The branch name of the repository's default branch. More specifically, the branch the PR should target. | No | main | _string_ |
| `pr_body_file` | Relative path to PR body file from the root of the repository.</br></br>Example: `'.github/utils/pr_body_update_deps.txt'`. | No | _Empty string_ | _string_ |
Expand Down
Loading