Difference between revisions of "Lazarus Continuous Integration"

From Lazarus wiki
Jump to navigationJump to search
(Added redirect to Lazarus_Team_-_Git_Workflows#Continuous_integration_.28CI.29_System. Let all workflow info be i one place for now.)
Tag: New redirect
Line 1: Line 1:
The page describes GitLab continous integration setup for Lazarus project
#REDIRECT [[Lazarus_Team_-_Git_Workflows#Continuous_integration_.28CI.29_System]][[Category:CI/CD]][[Category:SOPs]]
==Continuous Integration==
On every commit CI system creates a pipeline, which builds Lazarus for
several platforms/widgetsets. If the build fails, it notifies the
creator of commit which caused the failure.
The building process happens in a virtual machine (Docker container),
which loads an operating system image. Our image is based on Debian 11
x86_64 and currently contains GTK2, GTK3, Qt5 libraries and FPC
(versions 3.2.0, 3.2.2) for x86_64-linux with x86_64-win64 and
i386-win32 cross-compilers.
Docker image configuration is defined in Dockerfile.buildenv file, and
pipeline configuration is defined in .gitlab-ci.yml (both files located
in Lazarus root directory).
===Pipe Line===
Our pipeline currently consists of three stages:
1. Update our Docker image (see above). This process is triggered
manually and should be only run when Dockerfile.buildenv and/or FPC
version constants in .gitlab-ci.yml file were updated. Don't do this
without consulting with me first.
2. Update Qt5Pas bindings and cache the result of this job. This process
is triggered automatically when `lcl/interfaces/qt5/cbindings` directory
contents are changed. Its results are required for subsequent building
of Lazarus with Qt5 widgetset. This is needed because building Qt5
bindings takes a long time (~20 min) and they are rarely changed.
3. Build Lazarus for various widgetsets/platforms. Jobs currently
defined are building Lazarus for x86_64-gtk2, x86_64-qt5, x86_64-win64,
i386-win32 with two FPC versions (currently FPC 3.2.0 [oldstable] and
3.2.2 [stable]). x86_64-gtk2 (FPC 3.2.2), x86_64-qt5 (FPC 3.2.2) and
i386-win32 (FPC 3.2.0) are built automatically on every commit. All
others can be triggered manually via Gitlab web interface.
In [https://gitlab.com/freepascal.org/lazarus/lazarus Gitlab web interface] you can notice `CI/CD` menu item at the left. By
clicking `CI/CD`->`Pipelines` you will get to pipelines list, where you
can see build status for each commit. By clicking circles in the
`Stages` column you will get to submenus which will show status of all
jobs and will allow to run/rerun them manually (by clicking at
`play`/`retry` button) and to look at job's log (by clicking at job's name).
Normally you will see only two stages (1 and 3). Stage 2 is only shown
when Gitlab thinks that Qt5Pas bindings have to be rebuilt
(`lcl/interfaces/qt5/cbindings` directory contents are changed).
'''Important notice for Qt widgetsets:'''
They use cached results from stage 2. In absolute majority of the builds
this should not cause any problems. But still if you get Qt widgetset
build failure related to Qt5Pas version mismatch or missing cache, make
sure to go to the `Pipelines` page, stop the currently running pipeline
if needed, then press `Clear runner caches` button, then press `Run
pipeline` button (you will be asked about defining variables, just skip
this step (we don't use them) and confirm running pipeline).
==See Also==

Revision as of 23:06, 16 August 2022