Many plugin developers may not yet be aware that Qt Creator has an SDK. When developing the Qt Creator plugin using the SDK, there is no need to compile the entire Qt Creator. Additionally, for most C++developers, compiling, testing, and debugging plugins on three platforms (Windows, Linux, macOS) is not easy.

GitHub Actions

GitHub Actions is a fundamental CI/CD feature provided by GitHub that can run on all three platforms! GitHub also hosts code repositories for some Qt Creator plugins, so I am planning to try building the Doxygen plugin (on the fork version where I used GitHub Actions script).

GitHub Actions currently offers the following virtual machines (runners):


Ubuntu 16.04 LTS

Ubuntu 18.04 LTS

Windows Server 2016

Windows Server 2019

macOS 10.15


The Qt SDK was not initially installed on runners. This is not a problem, as we would like to use the same version of Qt and Qt Creator.

Developers can develop on one platform at a time, or they can develop an application on multiple platforms simultaneously (matrix pattern)

Prerequisite

Due to GitHub providing virtual machines and C++compilers, developers only need to obtain the Qt library and Qt Creator SDKs before they can start compiling.

I have decided to write a script to automatically download, decompress files, and compile. The script files are located in three files: CMake (entering script mode through the - P command line parameter).

I downloaded it from Qt.io downloaded the Qt SDK and Qt Creator binaries, source code, and SDK.

Compile plugins

To configure the plugin, developers need to run it

Qmake doxygen. pro PROFIG+=release QTCSOURCE="$ENV {GITHUB-WORKSPACE}/qtcreator" QTCSBUILD="$ENV {GITHUB-WORKSPACE}/qtcreator"

Compilation is also very simple, running

Make j<number of cores>or jom

Finally, we will have a dynamic link library (. dl,. so,. dynlib) that will be published to users.

Trigger GitHub Actions

After executing the git push, the plugin will be compiled, and each compiled temporary file will be stored. This looks like this:



If we mark a submission with the git tag - a v0.4.7-qtc-4.11- m "Release v0.4.7-qtc-4.11" command, and then submit with the git push originv0.4.7-qtc-4.11 command. This will trigger release compilation, and the intermediate files will be uploaded to that release. This looks like:


The newly created release is as follows:

Can it actually run?

GitHub Actions have some differences in platform and compiler conditions compared to compiling Qt and Qt Creator:

Visual C++2019 vs Visual C++2017

Red Hat 7.2 vs. Ubuntu 18.04

And practice has proven that Qt Creator can load plugins on three platforms!