mottosso / Qt.py

Minimal Python 2 & 3 shim around all Qt bindings - PySide, PySide2, PyQt4 and PyQt5.
MIT License
896 stars 252 forks source link

Convert CI/CD to GitHub actions. #391

Closed martin-chatterjee closed 5 months ago

martin-chatterjee commented 5 months ago

Objective

Convert CI/CD setup from Travis-CI to GitHub Actions.


Motivation

@mottosso commented here, in PR #376:

Calling in all assists! (...) We're currently on Travis-CI, because in the past it used to be free.. So part of the challenge would be converting it into GitHub Actions. (...)."

My long term goal is to have PySide6 support in Qt.py.

I see this PR as the first step before we can:


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


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:

mkdir -p ~/review-PR-391/
cd ~/review-PR-391/

git clone git@github.com:mottosso/Qt.py.git
cd Qt.py/

2. Add martin-chatterjee/Qt.py as a remote named "review", and fetch:

git remote add review git@github.com:martin-chatterjee/Qt.py.git
git fetch review

Test "Run test suite".

1. Check out PR branch, push to origin:

git checkout -b pr-391-review review/convert-to-github-actions
git push origin pr-391-review

→ 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 project Qt.py on both pypi.org and test.pypi.org.

2. Change project version to a unique version.

ℹ️ test.pypi.org and pypi.org only accept uploads for unique versions that have never been uploaded before.

Change version in Qt.py to something like:

__version__ = "1.3.9.dev1"

3. Commit and push.

git add .
git commit -m "Qt.py: Update version to '1.3.9.dev1'."  
git push origin pr-391-review

4. Create a test release tag, and push.

git tag 1.3.9.dev1-test-release
git push origin 1.3.9.dev1-test-release

→ 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.

CLAassistant commented 5 months ago

CLA assistant check
All committers have signed the CLA.

mottosso commented 5 months ago

Hi @martin-chatterjee, fantastic work, thanks for doing this!

My long term goal is to have PySide6 support in Qt.py.

Yes, agreed.

(Potentially using the official ASWF docker containers?)

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 temp, let's continue from there!

mottosso commented 5 months ago

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.

mottosso commented 5 months ago

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.

martin-chatterjee commented 5 months ago

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! 🙌