-
-
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
test: refactor CI #1433
Conversation
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
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 |
b982391
to
077cc35
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. Uses release notes extracted from CHANGELOG.md (during sdist job).
077cc35
to
8fb06fa
Compare
I added .github/workflows/parse_release_notes.py script to get the release's title and notes from the CHANGELOG.md file. When a tag is pushed, the version is extracted from the tag and used to identify the CHANGELOG entry. This means that each CHANGELOG entry must start with the following pattern: # <major>.<minor>.<patch> This conforms to the current pattern already used in the CHANGELOG.md file, but the new py script might behave unexpectedly if this pattern is not observed in the future. |
Awesome, thanks! |
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. Uses release notes extracted from CHANGELOG.md (during sdist job)