-
Notifications
You must be signed in to change notification settings - Fork 252
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
Convert CI/CD to GitHub actions. #391
Convert CI/CD to GitHub actions. #391
Conversation
'pgrep Xvfb' identifies the process by name, which is a more robust test. The output of 'ps aux | grep Xvfb' inside the Docker container running on Apple silicon is slightly different and incompatible with the previous while condition: $ ps aux | grep Xvfb root 3025 0.0 0.4 1451928 32588 pts/0 Sl 14:25 0:00 /rosetta/rosetta /usr/bin/Xvfb Xvfb :99 -screen 0 1024x768x16 root 3142 0.0 0.0 1206448 7808 pts/0 S+ 14:32 0:00 /rosetta/rosetta /usr/bin/grep grep --color=auto Xvfb
Prevent potential infinite loop if Xvfb is not able to start up, for whatever reason. Exit with exit code 124 ("Command timed out") after 60 seconds.
One-to-one conversion of the previous Travis CI based testing workflow. ❗️ Currently runs on every push ❗️
A separate Github Action will take care of the package deployment to PyPi. Therefore, the pip installation within the Docker container can be removed.
'Run tests' should not run on pushed tags, otherwise we it would get run twice unneccesarily during release tag push.
- Uses PyPA's release Github action. - The Github repo needs to be set up as a 'Trusted Publisher' on pypi.org. - ❗️ For testing purposes this workflow currently releases to test.pypi.org ❗️ → This needs to be removed before a potential merge into main.
Modern twine/build expects long_description to be set. This way 'README.md' will be displayed on https://pypi.org/project/Qt.py/.
This way it will also render correctly on https://pypi.org/project/Qt.py/.
❗️ Currently references 'martin-chatterjee/Qt.py', for testing purposes. ❗️
❗️ Currently states 'version 1.3.9'. This is an assumption, and needs to be changed before merge. ❗️
Test-releases to 'test.pypi.org' as project 'martin-chatterjee-Qt.py'.
Hi @martin-chatterjee, fantastic work, thanks for doing this!
Yes, agreed.
This wasn't an option in the past (2020 and earlier), but nowadays it sounds likely and sensible. I'm going to try and trigger a few builds for this so we can make sure things work, but I think we need to actually merge and tag for this to happen so I've changed this base to |
Looks like a success!
Great work, I know from experience this must have taken you a lot of sweat and tears; dealing with cloud-based CI is forever and always a huge pain. Merging this into master now and distributing the new 1.3.9 version. |
Also gotta say, this is one of the best PR's I've ever gotten. An example in how to make a good first impression, how to get your PR merged quick and how to pay attention to details, with even the README updated to reflect the change. Well done. |
Thanks for the kind words @mottosso, really appreciate it. 🙂🙏 Stoked to see this one being reviewed, approved and merged so fast – keep up the good work! 🙌 |
Objective
Convert CI/CD setup from Travis-CI to GitHub Actions.
Motivation
@mottosso commented here, in PR #376:
My long term goal is to have PySide6 support in
Qt.py
.I see this PR as the first step before we can:
(Potentially using the official ASWF docker containers?)
Details
The configurations for GitHub Actions live in
.github/workflows/
.I have separated the previous Travis-CI configuration into two separate workflows.
1. Run the test suite
→
.github/workflows/run-tests.yml
ubuntu-latest
GitHub runners, using the same docker images.2. Release to PyPi
→
.github/workflows/release-to-pypi.yml
PyPi
, using PyPi's own official GitHub PyPi Publish actions.mottosso
.Qt.py
project.test.pypi.org
, for testing purposes.Test instructions
Testing this PR requires a bit more effort, because it needs to be pushed to
mottosso/Qt.py
in order to be able to test GitHub Actions.Preparation
1. Check out
mottosso/Qt.py
:2. Add
martin-chatterjee/Qt.py
as a remote named"review"
, and fetch:Test "Run test suite".
1. Check out PR branch, push to
origin
:→ Visit https://github.com/mottosso/Qt.py/actions, to see the resulting workflow run.
Test "Release to PyPi".
ℹ️ This PR is set up to release to
test.pypi.org
.→ This must be changed after all tests, and before a potential merge into
main
.1. Make sure that
mottosso/Qt.py
is registered as a "Trusted Publisher".In a nutshell, a specific GitHub repo can be registered as a "Trusted Publisher" for a specific PyPi project.
(→ More details here)
❗️ Please make sure to register
mottosso/Qt.py
for PyPi projectQt.py
on bothpypi.org
andtest.pypi.org
.2. Change project version to a unique version.
ℹ️
test.pypi.org
andpypi.org
only accept uploads for unique versions that have never been uploaded before.→ Change version in
Qt.py
to something like:3. Commit and push.
4. Create a test release tag, and push.
→ Visit https://github.com/mottosso/Qt.py/actions, to see the resulting workflow run.
→ Visit https://test.pypi.org/project/Qt.py/, to see the released version.