GitHub Actions CI best-known-methods to support Qt applications
-
We are using GitHub actions for our CI, and we want to bring in Qt to some of our applications.
What is the best-known method to install the required Qt components to leverage GitHub CI?
-
Hi and welcome to devnet,
You can use the aqtinstall project for that.
The Qt online installer now also has a batch mode that should allow you to do this.
There's also an existing action based on aqtinstall that might be of interest (I have not used it yet). -
I want to second @SGaist 's mention of aqtinstall. I have found it effective, ergonomic, and stable while using it (since at least 2020) to support builds for a number of platforms: linux, windows, mac, android, ios. In addition to the aqtinstall docs that @SGaist linked to, you can take a look at aqtinstall github activity to see their good communication and upkeep.
Other options you might consider:
- building your own set of Qt libs (offline, pre-CI) ; hosting them somewhere; using
curl
orwget
or similar to retrieve them in CI. - building your own docker container with Qt libs inside it, and following GitHub docs about running actions in your own chosen container (instead of GitHub "runner" VMs).
- building your own set of Qt libs (offline, pre-CI) ; hosting them somewhere; using
-
Also supporting @SGaist's reply, for GitHub Actions, I use the install-qt-action action quite a lot. Here's a bit of an extreme example of a project of mine that builds on GitHub Actions for all latest Qt minor releases from Qt 5.9 to 6.9 Beta 2, on Linux, Windows and macOS (skipping Qt 6.0 and 6.1 though, just because they don't support Bluetooth, which that project uses), with gcc, clang, msvc and mingw, for x86, x86-64 and arm64 (currently 146 different bulds) : https://github.com/pcolby/dokit/blob/main/.github/workflows/build.yaml
More than happy to try to answer any questions you might have about Qt on GitHub Actions, since I've had to figure out a lot of the corner cases the hard way! But most of my learnings are covered in the comments in that
build.yaml
file :)Cheers.