Utility > GitHub Actions for Lazarus/FPC
setup-lazarus

Set up your GitHub Actions workflow with a specific version of Lazarus
[!WARNING] I'm no longer able, or willing to continue updating this action.
I've asked one of the most prominent users of this action if he could take over, and his reply was that he also does not have the time for it.
I'm now extending the ask for help to anyone that's willing to continue maintaining this action.I'll be eternally grateful to the person that does so!!
[!IMPORTANT] When building with the
Qt5widgetset, using the combination ofstableorv3.0withubuntu-latestorubuntu-22.04may fail. This issue is due to an outdatedlibqt5paslibrary that doesn't support Lazarus 3.0 updates. A solution is to download a newer version oflibqt5pasfrom the link below: https://github.com/davidbannon/libqt5pas/releases.
We apologize for the inconvenience and appreciate your patience.
Inputs
lazarus-version (required, default: 'dist')
Possible values:
| Lazarus Version | FPC Version | Description |
|---|---|---|
| dist | Latest stable | |
| stable | Lazarus 4.4 | |
| 4.4 | 3.2.2 | |
| 4.2 | 3.2.2 | |
| 4.0 | 3.2.2 | |
| 3.8 | 3.2.2 | |
| 3.6 | 3.2.2 | |
| 3.4 | 3.2.2 | |
| 3.2 | 3.2.2 | |
| 3.0 | 3.2.2 | |
| 2.2.6 | 3.2.2 | |
| 2.2.4 | 3.2.2 | |
| 2.2.2 | 3.2.2 | |
| 2.2.0 | 3.2.2 | |
| 2.0.12 | 3.2.0 | |
| 2.0.10 | 3.2.0 | |
| 2.0.8 | 3.0.4 | |
| 2.0.6 | 3.0.4 | |
| 2.0.4 | 3.0.4 | |
| 2.0.2 | 3.0.4 | |
| 2.0.0 | 3.0.4 | |
| 1.8.4 | 3.0.4 | |
| 1.8.2 | 3.0.4 | |
| 1.8.0 | 3.0.4 | |
| 1.6.4 | 3.0.2 | |
| 1.6.2 | 3.0.0 | |
| 1.6 | 3.0.0 | |
| 1.4.4 | 2.6.4 | |
| 1.4.2 | 2.6.4 | |
| 1.4 | 2.6.4 | |
| 1.2.6 | 2.6.4 | |
| 1.2.4 | 2.6.4 | |
| 1.2.2 | 2.6.4 | |
| 1.2 | 2.6.2 | |
| 1.2 | 2.6.2 | |
| 1.0.14 | 2.6.2 | |
| 1.0.12 | 2.6.2 |
[!NOTE] 'dist' is the Lazarus package that comes with the Ubuntu dist you chose on
runs-on, while for Windows it's the latest stable (4.4).
include-packages
List of packages to install. You can ask the action to fetch packages and install them after Lazarus is installed. Format is a string with the packages separated by comma: "Package 1, Package 2, Package 3". The list of packages can be searched at the Lazarus IDE repository.
with-cache (default: false)
Use cached installer files.
This is a boolean input and will use cache if set to true.
[!NOTE] At this moment, there's an issue with the retrieved install executables for Windows. I'm trying to get to the bottom of why, but it's going to take some time. Caching is now off by default for Windows until I can solve this issue!
Platforms
At the moment this action only supports:
- Windows (win32-x64)
- Linux (linux-x64)
- macOS (darwin-x64)
IMPORTANT
Due to the hard work of Levi there is now support for macOS.
Unfortunately there are some restrictions:
- The GitHub macOS runners only support Lazarus versions 2.0.8 and up.
- Until further notice only Cocoa widgset is supported on macOS runners.
Example usage
steps:
- uses: actions/checkout@v4
- uses: gcarreno/setup-lazarus@v3
with:
lazarus-version: "stable"
include-packages: "Synapse 40.1"
with-cache: true
- run: lazbuild YourTestProject.lpi
- run: YourTestProject
Matrix example usage
name: build
on:
pull_request:
push:
paths-ignore:
- "README.md"
branches:
- master
- releases/*
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [windows-latest, ubuntu-latest, macos-latest]
lazarus-versions: [dist, stable, 2.2.0, 2.0.12, 2.0.10, 2.0.8, 2.0.6]
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Lazarus
uses: gcarreno/setup-lazarus@v3
with:
lazarus-version: ${{ matrix.lazarus-versions }}
include-packages: "Synapse 40.1"
with-cache: true
- name: Build the Main Application
if: ${{ matrix.operating-system != 'macos-latest' }}
run: lazbuild -B "src/lazaruswithgithubactions.lpi"
- name: Build the Main Application (macOS)
if: ${{ matrix.operating-system == 'macos-latest' }}
run: lazbuild -B --ws=cocoa "src/lazaruswithgithubactions.lpi"
- name: Build the Unit Tests Application
run: lazbuild -B "tests/testconsoleapplication.lpi"
- name: Run the Unit Tests Application
run: bin/testconsoleapplication "--all" "--format=plain"