Home

Awesome

setup-lazarus

setup-lazarus logo

Actions Status

Set up your GitHub Actions workflow with a specific version of Lazarus

[!IMPORTANT] When building with the Qt5 widgetset, using the combination of stable or v3.0 with ubuntu-latest or ubuntu-22.04 may fail. This issue is due to an outdated libqt5pas library that doesn't support Lazarus 3.0 updates. A solution is to download a newer version of libqt5pas from 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 VersionFPC VersionDescription
distLatest stable
stableLazarus 3.6
3.63.2.2
3.43.2.2
3.23.2.2
3.03.2.2
2.2.63.2.2
2.2.43.2.2
2.2.23.2.2
2.2.03.2.2
2.0.123.2.0
2.0.103.2.0
2.0.83.0.4
2.0.63.0.4
2.0.43.0.4
2.0.23.0.4
2.0.03.0.4
1.8.43.0.4
1.8.23.0.4
1.8.03.0.4
1.6.43.0.2
1.6.23.0.0
1.63.0.0
1.4.42.6.4
1.4.22.6.4
1.42.6.4
1.2.62.6.4
1.2.42.6.4
1.2.22.6.4
1.22.6.2
1.22.6.2
1.0.142.6.2
1.0.122.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 (3.6).

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:

IMPORTANT

Due to the hard work of Levi there is now support for macOS.

Unfortunately there are some restrictions:

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"