-
-
Notifications
You must be signed in to change notification settings - Fork 404
test: refactor CI #1433
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
base: master
Are you sure you want to change the base?
test: refactor CI #1433
Conversation
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
TAG: ${{ github.ref_name }} | ||
REPO: ${{ github.repository }} | ||
# https://cli.github.com/manual/gh_release_create | ||
run: >- | ||
gh release create ${TAG} | ||
--verify-tag | ||
--repo ${REPO} | ||
--title ${TAG} | ||
--generate-notes |
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.
This can be removed if you find it undesirable.
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 will keep writing the changelog manually so better to remove the --generate-notes line.
But this will send notifications on releases, that's good.
I noticed that the tests take about 20 seconds for each wheel. Here are some tips to conditionally reduce the number of tests executed: Using pytest markersIf you want to exclude certain tests where the platform architecture should not affect the outcome, then you can use @pytest.mark.platform_agnostic
def test_something() -> None: ... # pytest.ini
markers =
platform_agnostic: test that is not affected by platform architecture # pyproject.toml
[[tool.cibuildwheel.override]]
select = "cp3{11,12,13,14,14t}-{macosx,win,linux}-*"
# skip platform-agnostic tests for all wheels built on
# macos, windows, and linux using
# any python version 3.11-3.14(t)
# NOTE: assumes python 3.10 is minimum supported version.
test-command = "pytest -m 'no platform_agnostic'" Using
|
91556e3
to
420852c
Compare
per request from libgit2#1432 (comment) closes libgit2#1366 ### Changes - remove all test jobs from test.yml workflow except the one that runs on s390x platform. - rename the test.yml Display name accordingly: "Tests (s390x)" - skip building ppc64le wheels when not triggered on master branch. - reconfigure wheels.yml workflow triggers. The wheels.yml CI now runs for 1. any push to master branch 2. any change in a PR that targets master branch (excluding when PR changes only affect docs/ path) 3. any tag (starting with "v") is pushed - added `skip-existing` param in case deployment to PyPI suffers a network error and the CI just needs to be re-run. - cherry pick changes from PR libgit2#1366 (about CI triggers for lint and spell-check CI workflows) - auto-cancel wheels CI if new run triggered on non-default branch - use pytest.ini in cibuildwheel isolated env - added step to job that deploys wheels to PyPI. This new step creates a GitHub Release for the tag that was pushed.
420852c
to
b982391
Compare
LGTM. There is just the changelog generation to be removed, unless you think it can be generated from the CHANGELOG.md file, with --notes maybe? |
The thought did occur, but it wouldn't be a simple solution. I'd have to parse the changelog file to get only the recently added entry/section. I think that would require a few lines of python code. Alternatively, (without |
per request from #1432 (comment)
closes #1366
Changes
remove all test jobs from test.yml workflow except the one that runs on s390x platform.
rename the test.yml Display name accordingly: "Tests (s390x)"
skip building ppc64le wheels when not triggered on master branch.
reconfigure wheels.yml workflow triggers. The wheels.yml CI now runs for
auto-cancel wheels.yml CI run if a new run is triggered (does not cancel runs on master branch).
added
skip-existing
param in case deployment to PyPI suffers a network error and the CI just needs to be re-run.cherry-pick changes from ci: change triggers to prevent dual runs on prs #1366 (about CI triggers for lint and spell-check CI workflows)
use pytest.ini in cibuildwheel isolated env
added step to job that deploys wheels to PyPI. This new step creates a GitHub Release for the tag that was pushed.