Code Monkey home page Code Monkey logo

setup-lazarus's Introduction

setup-lazarus

setup-lazarus logo

Actions Status

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

VERY IMPORTANT NOTICE

When build for the Qt5 widgetset, the combination of stable/v3.0 and ubuntu-latest/ubuntu-22.04 is going to fail.

This is due to the fact that libqt5pas is outdated and does not support the new code delivered by Lazarus 3.0.

This is a problem related to the Ubuntu distribution's repositories and the version of libqt5pas they carry, used by the GitHub runners.

According to the maintainer of said libqt5pas, in this answer, one solution is to have the workflow script download and install a newer version.

The newer version can be obtained here: https://github.com/davidbannon/libqt5pas/releases

Thank you for your patience, continued support and please accept my deepest apologies for this inconvenience.

Inputs

lazarus-version

REQUIRED Lazarus version.

DEFAULT dist.

Possible values:

  • dist - Lazarus package that comes with the Ubuntu dist you chose on runs-on and for Windows the latest stable
  • stable - Installs the latest stable version: 3.0
  • 3.0 - comes with FPC v3.2.2
  • 2.2.6 - comes with FPC v3.2.2
  • 2.2.4 - comes with FPC v3.2.2
  • 2.2.2 - comes with FPC v3.2.2
  • 2.2.0 - comes with FPC v3.2.2
  • 2.0.12 - comes with FPC v3.2.0
  • 2.0.10 - comes with FPC v3.2.0
  • 2.0.8 - comes with FPC v3.0.4
  • 2.0.6 - comes with FPC v3.0.4
  • 2.0.4 - comes with FPC v3.0.4
  • 2.0.2 - comes with FPC v3.0.4
  • 2.0.0 - comes with FPC v3.0.4
  • 1.8.4 - comes with FPC v3.0.4
  • 1.8.2 - comes with FPC v3.0.4
  • 1.8.0 - comes with FPC v3.0.4
  • 1.6.4 - comes with FPC v3.0.2
  • 1.6.2 - comes with FPC v3.0.0
  • 1.6 - comes with FPC v3.0.0
  • 1.4.4 - comes with FPC v2.6.4
  • 1.4.2 - comes with FPC v2.6.4
  • 1.4 - comes with FPC v2.6.4
  • 1.2.6 - comes with FPC v2.6.4
  • 1.2.4 - comes with FPC v2.6.4
  • 1.2.2 - comes with FPC v2.6.4
  • 1.2 - comes with FPC v2.6.2
  • 1.2 - comes with FPC v2.6.2
  • 1.0.14 - comes with FPC v2.6.2
  • 1.0.12 - comes with FPC v2.6.2

include-packages

OPTIONAL 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

OPTIONAL Use cached installer files.

DEFAULT true.

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 (platform=win32, arch=x64)
  • Linux (platform=linux, arch=x64)
  • macOS (platform=darwin, arch=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"

setup-lazarus's People

Contributors

dependabot[bot] avatar gcarreno avatar leviable avatar rdipardo avatar zhymabekroman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup-lazarus's Issues

Implement runs-on for macos-latest at least

Up to date Googling suggest the following to install a *.dmg from the command line:

# usage: installdmg https://example.com/path/to/pkg.dmg
function installdmg {
    set -x
    tempd=$(mktemp -d)
    curl $1 > $tempd/pkg.dmg
    listing=$(sudo hdiutil attach $tempd/pkg.dmg | grep Volumes)
    volume=$(echo "$listing" | cut -f 3)
    if [ -e "$volume"/*.app ]; then
      sudo cp -rf "$volume"/*.app /Applications
    elif [ -e "$volume"/*.pkg ]; then
      package=$(ls -1 "$volume" | grep .pkg | head -1)
      sudo installer -pkg "$volume"/"$package" -target /
    fi
    sudo hdiutil detach "$(echo "$listing" | cut -f 1)"
    rm -rf $tempd
    set +x
}

Linker errors on FPC 3.0.4 under ubuntu-latest (22.04)

Under Lazarus 1.8.4 and 2.0.8 (and probably others), the error is as follows:

/usr/bin/ld: /usr/lib/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o: in function `_start':
(.text+0x3c): undefined reference to `__libc_csu_init'
/usr/bin/ld: (.text+0x43): undefined reference to `__libc_csu_fini'
Error: (9013) Error while linking
Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Lazarus version based on FPC 3.2.0 (from 2.0.10) build successfully.

The build was also successful on Lazarus 2.0.8 before ubuntu-latest has changed from 20.04 to 22.04.

Please take a look :)

Windows: add path to FPC to PAHT env variable

Hi,
any chance after Lazarus installation is finished the path to fpc.exe could be added to PATH environmental variable? It looks like the FPC version could be taken from Laz installer name lazarus-2.2.0-fpc-3.2.2-win64.exe.
It's possible to use directly e.g. D:\a\_temp\lazarus\fpc\3.2.2\bin\x86_64-win64\fpc.exe now
but that looks pretty fragile.

Or is there some way how to get path to FPC (or at least FPC version) from lazbuild that I missed?

Does setup-lazarus action use cache?

Hello,

thanks a lot for your work! It's not an issue, rather the question. Does setup-lazarus action use GHA caching functionality or binaries are installed/downloaded from scratch every time?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.