-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add GitHub Actions workflows for CI and automated PyPI publishing #14
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
Merged
jcpitre
merged 6 commits into
main
from
3-infrastructure-generic-gtfs-diff-engine-publish-package
Jun 8, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
61a45fd
Add GitHub Actions workflows for CI and automated PyPI publishing
jcpitre cd6f8bb
Added manual trigger for the test workflow.
jcpitre 72fb324
Merge branch 'main' into 3-infrastructure-generic-gtfs-diff-engine-pu…
jcpitre e91abed
Removed some triggers for the test workflows since they are handled b…
jcpitre 07f7f5c
Trim python-test.yml to oldest and latest Python versions only
jcpitre 0ad648e
Used the same versions in ci.yml and python-test.yml
jcpitre 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: Python Release | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| test: | ||
| uses: ./.github/workflows/python-test.yml | ||
|
|
||
| publish: | ||
| needs: test | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/gtfs-diff-engine/ | ||
| permissions: | ||
| id-token: write # Required for PyPI Trusted Publisher (OIDC) | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install build backend | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build | ||
|
|
||
| - name: Build distributions | ||
| run: | | ||
| python -m build | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| verbose: true |
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,29 @@ | ||
| name: Python Tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| # Oldest and latest supported versions — sufficient to catch compatibility issues | ||
| python-version: ["3.10", "3.12", "3.14"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install package | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
|
|
||
| - name: Run tests | ||
| run: python -m pytest tests/ -v | ||
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
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.
I believe this is already covered by
ci.ymlUh oh!
There was an error while loading. Please reload this page.
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.
Do we want tests to run before release? Or do we trust that ci.yml ran properly?
python-test.yml is essentially called from python-release.yml.
It could have been embedded in python-release.yml.
I suggest we keep both.
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.
sure! could we support the same python versions?
Uh oh!
There was an error while loading. Please reload this page.
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.
Done.
The rationale for the versions used in python-test.yml was that if it works with 3.13 then it must work with 3.12. But it's not guaranteed, so your comment is spot on.
I curious to know why you did not include 3.11 in the list of versions?
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.
My understanding at the time was that python 3.10 is still supported (security updates), but not 3.11. I just looked it up i'm completely wrong they are both in their final "security-only" support phase.