-
Notifications
You must be signed in to change notification settings - Fork 38
Use reusable workflow to eliminate setup duplication between test and collateral #199
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
Draft
Copilot
wants to merge
3
commits into
main
Choose a base branch
from
copilot/explore-reusable-workflows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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,60 @@ | ||
| name: Test Suite | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| python: | ||
| description: Python version | ||
| type: string | ||
| default: "3.x" | ||
| platform: | ||
| description: Runner platform | ||
| type: string | ||
| default: ubuntu-latest | ||
| tox-env: | ||
| description: >- | ||
| Tox environment to run; if empty, runs default tox | ||
| type: string | ||
| default: "" | ||
|
|
||
| env: | ||
| # Environment variable to support color support (jaraco/skeleton#66) | ||
| FORCE_COLOR: 1 | ||
|
|
||
| # Suppress noisy pip warnings | ||
| PIP_DISABLE_PIP_VERSION_CHECK: 'true' | ||
| PIP_NO_WARN_SCRIPT_LOCATION: 'true' | ||
|
|
||
| # Ensure tests can sense settings about the environment | ||
| TOX_OVERRIDE: >- | ||
| testenv.pass_env+=GITHUB_*,FORCE_COLOR | ||
|
|
||
| jobs: | ||
| run: | ||
| runs-on: ${{ inputs.platform }} | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install build dependencies | ||
| # Install dependencies for building packages on pre-release Pythons | ||
| # jaraco/skeleton#161 | ||
| if: inputs.python == '3.15' && inputs.platform == 'ubuntu-latest' | ||
| run: | | ||
| sudo apt update | ||
| sudo apt install -y libxml2-dev libxslt-dev | ||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ inputs.python }} | ||
| allow-prereleases: true | ||
| - name: Install tox | ||
| run: python -m pip install tox | ||
| - name: Run | ||
| if: ${{ !inputs.tox-env }} | ||
| run: tox | ||
| - name: Run ${{ inputs.tox-env }} | ||
| if: ${{ inputs.tox-env }} | ||
| run: tox -e ${{ inputs.tox-env }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This content is duplicated with main.yml. Is it possible for it to be shared or only defined in one place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Actions doesn't propagate a calling workflow's
envinto a reusable workflow — they're separate contexts, so the duplication was previously unavoidable.Since
testandcollateralnow fully delegate totest-suite.yml, theenvblock inmain.ymlwas no longer serving any job there (the only remaining inline-step job isrelease, which doesn't need those vars). Removed it in 62e53f8 — the env is now defined in one place only (test-suite.yml).