From bddc8fa9e206de0ea515f7f3024f4204508f1b25 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 13 Jan 2025 20:41:58 +0200 Subject: [PATCH 01/11] Rewrote CI to Pascal --- .github/workflows/make.pas | 149 +++++++++++++++++++++++++++++++++ .github/workflows/make.ps1 | 167 ------------------------------------- .github/workflows/make.sh | 98 ---------------------- .github/workflows/make.yml | 20 +---- 4 files changed, 153 insertions(+), 281 deletions(-) create mode 100644 .github/workflows/make.pas delete mode 100644 .github/workflows/make.ps1 delete mode 100644 .github/workflows/make.sh diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas new file mode 100644 index 0000000..3e36fd3 --- /dev/null +++ b/.github/workflows/make.pas @@ -0,0 +1,149 @@ +program Make; +{$mode objfpc}{$H+} + +uses + Classes, + SysUtils, + StrUtils, + FileUtil, + Zipper, + fphttpclient, + openssl, + opensslsockets, + Process; + +const + Src: string = 'Examples'; + Use: string = 'Package'; + Tst: string = 'testconsole.lpi'; + Pkg: array of string = ('PoweredBy', 'EyeCandyControls', 'splashabout', 'DCPcrypt'); + +var + Output, Line: ansistring; + List: TStringList; + Each, Item, PackagePath, TempFile, Url: string; + Zip: TStream; + +begin + InitSSLInterface; + if FileExists('.gitmodules') then + if RunCommand('git', ['submodule', 'update', '--init', '--recursive', + '--force', '--remote'], Output) then + Writeln(#27'[33m', Output, #27'[0m') + else + begin + ExitCode += 1; + Writeln(#27'[31m', Output, #27'[0m'); + end; + List := FindAllFiles(Use, '*.lpk', True); + try + for Each in List do + if RunCommand('lazbuild', ['--add-package-link', Each], Output) then + Writeln(#27'[33m', 'added ', Each, #27'[0m') + else + begin + ExitCode += 1; + Writeln(#27'[31m', 'added ', Each, #27'[0m'); + end; + finally + List.Free; + end; + for Each in Pkg do + begin + PackagePath := GetEnvironmentVariable('HOME') + + '/.lazarus/onlinepackagemanager/packages/' + Each; + TempFile := GetTempFileName; + Url := 'https://packages.lazarus-ide.org/' + Each + '.zip'; + if not DirectoryExists(PackagePath) then + begin + Zip := TFileStream.Create(TempFile, fmCreate or fmOpenWrite); + with TFPHttpClient.Create(nil) do + begin + try + AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); + AllowRedirect := True; + Get(Url, Zip); + WriteLn('Download from ', Url, ' to ', TempFile); + finally + Free; + end; + end; + Zip.Free; + CreateDir(PackagePath); + with TUnZipper.Create do + begin + try + FileName := TempFile; + OutputPath := PackagePath; + Examine; + UnZipAllFiles; + WriteLn('Unzip from ', TempFile, ' to ', PackagePath); + finally + Free; + end; + end; + DeleteFile(TempFile); + List := FindAllFiles(PackagePath, '*.lpk', True); + try + for Item in List do + if RunCommand('lazbuild', ['--add-package-link', Item], Output) then + Writeln(#27'[33m', 'added ', Item, #27'[0m') + else + begin + ExitCode += 1; + Writeln(#27'[31m', 'added ', Item, #27'[0m'); + end; + finally + List.Free; + end; + end; + end; + List := FindAllFiles('.', Tst, True); + try + for Each in List do + begin + Writeln(#27'[33m', 'build ', Each, #27'[0m'); + if RunCommand('lazbuild', ['--build-all', '--recursive', + '--no-write-project', Each], Output) then + for Line in SplitString(Output, LineEnding) do + begin + if Pos('Linking', Line) <> 0 then + begin + if not RunCommand('command', [SplitString(Line, ' ')[2], + '--all', '--format=plain', '--progress'], Output) then + ExitCode += 1; + WriteLn(Output); + end; + end + else + for Line in SplitString(Output, LineEnding) do + if Pos('Fatal', Line) <> 0 and Pos('Error', Line) then + Writeln(#27'[31m', Line, #27'[0m'); + end; + finally + List.Free; + end; + List := FindAllFiles(Src, '*.lpi', True); + try + for Each in List do + begin + Write(#27'[33m', 'build from ', Each, #27'[0m'); + if RunCommand('lazbuild', ['--build-all', '--recursive', + '--no-write-project', Each], Output) then + for Line in SplitString(Output, LineEnding) do + begin + if Pos('Linking', Line) <> 0 then + Writeln(#27'[32m', ' to ', SplitString(Line, ' ')[2], #27'[0m'); + end + else + begin + ExitCode += 1; + for Line in SplitString(Output, LineEnding) do + if Pos('Fatal', Line) <> 0 and Pos('Error', Line) then + Writeln(#27'[31m', Line, #27'[0m'); + end; + end; + finally + List.Free; + end; +end. diff --git a/.github/workflows/make.ps1 b/.github/workflows/make.ps1 deleted file mode 100644 index 98bdf2a..0000000 --- a/.github/workflows/make.ps1 +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env pwsh -############################################################################################################## - -Function Show-Usage { - " -vagrant = 'it-gro/win10-ltsc-eval' -download = 'https://microsoft.com/en-us/evalcenter' -package = 'https://learn.microsoft.com/en-us/mem/configmgr/develop/apps/how-to-create-the-windows-installer-file-msi' -shell = 'https://learn.microsoft.com/en-us/powershell' - -Usage: pwsh -File $($PSCommandPath) [OPTIONS] -Options: - build - lint -" | Out-Host -} - -Function Build-Project { - New-Variable -Option Constant -Name VAR -Value @{ - Src = 'Examples' - Use = 'Package' - Pkg = 'Package\components.txt' - } - If (! (Test-Path -Path $Var.Src)) { - "$([char]27)[31m.... Source do not find!$([char]27)[0m" | Out-Host - Exit 1 - } - If (Test-Path -Path '.gitmodules') { - & git submodule update --init --recursive --force --remote | Out-Host - "$([char]27)[32m.... [[$($LastExitCode)]] git submodule update$([char]27)[0m" | Out-Host - } - @( - @{ - Cmd = 'lazbuild' - Url = 'https://fossies.org/windows/misc/lazarus-3.6-fpc-3.2.2-win64.exe' - Path = "C:\Lazarus" - } - ) | Where-Object { ! (Test-Path -Path $_.Path) } | - ForEach-Object { - $_.Url | Request-File | Install-Program - $Env:PATH+=";$($_.Path)" - (Get-Command $_.Cmd).Source | Out-Host - } - If (Test-Path -Path $VAR.Use) { - If (Test-Path -Path $VAR.Pkg) { - Get-Content -Path $VAR.Pkg | - Where-Object { - ! (Test-Path -Path "$($VAR.Use)\$($_)") && - ! (& lazbuild --verbose-pkgsearch $_ ) && - ! (& lazbuild --add-package $_) - } | ForEach-Object { - Return @{ - Uri = "https://packages.lazarus-ide.org/$($_).zip" - Path = "$($VAR.Use)\$($_)" - OutFile = (New-TemporaryFile).FullName - } - } | ForEach-Object -Parallel { - Invoke-WebRequest -OutFile $_.OutFile -Uri $_.Uri - Expand-Archive -Path $_.OutFile -DestinationPath $_.Path - Remove-Item $_.OutFile - Return "$([char]27)[32m.... download $($_.Uri)$([char]27)[0m" - } | Out-Host - } - (Get-ChildItem -Filter '*.lpk' -Recurse -File –Path $VAR.Use).FullName | - ForEach-Object { - & lazbuild --add-package-link $_ | Out-Null - Return "$([char]27)[32m.... [$($LastExitCode)] add package link $($_)$([char]27)[0m" - } | Out-Host - } - Exit ( - (Get-ChildItem -Filter '*.lpi' -Recurse -File –Path $Var.Src).FullName | - Sort-Object | - ForEach-Object { - $Output = (& lazbuild --build-all --recursive --no-write-project $_) - $Result = @("$([char]27)[32m.... [$($LastExitCode)] build project $($_)$([char]27)[0m") - $exitCode = Switch ($LastExitCode) { - 0 { - $Result += $Output | Select-String -Pattern 'Linking' - 0 - } - Default { - $Result += $Output | Select-String -Pattern 'Error:', 'Fatal:' - 1 - } - } - $Result | Out-Host - Return $exitCode - } | Measure-Object -Sum - ).Sum -} - -Function Request-File { - While ($Input.MoveNext()) { - New-Variable -Option Constant -Name VAR -Value @{ - Uri = $Input.Current - OutFile = (Split-Path -Path $Input.Current -Leaf).Split('?')[0] - } - Invoke-WebRequest @VAR - Return $VAR.OutFile - } -} - -Function Install-Program { - While ($Input.MoveNext()) { - Switch ((Split-Path -Path $Input.Current -Leaf).Split('.')[-1]) { - 'msi' { - & msiexec /passive /package $Input.Current | Out-Null - } - Default { - & ".\$($Input.Current)" /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART | Out-Null - } - } - Remove-Item $Input.Current - } -} - -Function Request-URL([Switch] $Post) { - $VAR = Switch ($Post) { - True { - Return @{ - Method = 'POST' - Headers = @{ - ContentType = 'application/json' - } - Uri = 'https://postman-echo.com/post' - Body = @{ - One = '1' - } | ConvertTo-Json - } - } - False { - Return @{ - Uri = 'https://postman-echo.com/get' - } - } - } - Return (Invoke-WebRequest @VAR | ConvertFrom-Json).Headers -} - -Function Switch-Action { - $ErrorActionPreference = 'stop' - Set-PSDebug -Strict #-Trace 1 - Invoke-ScriptAnalyzer -EnableExit -Path $PSCommandPath - If ($args.count -gt 0) { - Switch ($args[0]) { - 'lint' { - Invoke-ScriptAnalyzer -EnableExit -Recurse -Path '.' - (Get-ChildItem -Filter '*.ps1' -Recurse -Path '.').FullName | - ForEach-Object { - Invoke-Formatter -ScriptDefinition $(Get-Content -Path $_ | Out-String) | - Set-Content -Path $_ - } - } - 'build' { - Build-Project - } - Default { - Show-Usage - } - } - } Else { - Show-Usage - } -} - -############################################################################################################## -Switch-Action @args diff --git a/.github/workflows/make.sh b/.github/workflows/make.sh deleted file mode 100644 index 9e6ed05..0000000 --- a/.github/workflows/make.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env bash -############################################################################################################## - -function priv_clippit -( - cat <&2 - fi - declare -i errors=0 - while read -r; do - declare -A TMP=( - [out]=$(mktemp) - ) - if (lazbuild --build-all --recursive --no-write-project "${REPLY}" > "${TMP[out]}"); then - printf '\x1b[32m\t[%s]\t%s\x1b[0m\n' "${?}" "${REPLY}" - grep --color='always' 'Linking' "${TMP[out]}" - else - printf '\x1b[31m\t[%s]\t%s\x1b[0m\n' "${?}" "${REPLY}" - grep --color='always' --extended-regexp '(Error|Fatal):' "${TMP[out]}" - ((errors+=1)) - fi 1>&2 - rm "${TMP[out]}" - done < <(find "${VAR[src]}" -type 'f' -name '*.lpi' | sort) - exit "${errors}" -) - -function priv_main -( - set -euo pipefail - if ((${#})); then - case ${1} in - build) priv_lazbuild ;; - *) priv_clippit ;; - esac - else - priv_clippit - fi -) - -############################################################################################################## -priv_main "${@}" >/dev/null diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 006d55c..a90dc85 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -24,26 +24,14 @@ jobs: matrix: os: - ubuntu-latest - - windows-latest steps: - name: Checkout uses: actions/checkout@v4 with: submodules: true - - name: Build on Linux - if: runner.os == 'Linux' + - name: Build shell: bash - run: bash .github/workflows/make.sh build - - - name: Build on Windows - if: runner.os == 'Windows' - shell: powershell - run: pwsh -File .github/workflows/make.ps1 build - - - name: Archive - if: runner.os == 'Windows' - uses: actions/upload-artifact@v4 - with: - retention-days: 1 - path: src\bin\*.exe + run: | + sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null + instantfpc "-Fu/usr/lib/lazarus/3.0/components/lazutils" .github/workflows/make.pas From 5077193fb168e2e6840095c47a7b03e6c80282ff Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 13 Jan 2025 20:47:51 +0200 Subject: [PATCH 02/11] Rewrote CI to Pascal --- .github/workflows/make.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index 3e36fd3..8917ee5 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -16,7 +16,7 @@ Src: string = 'Examples'; Use: string = 'Package'; Tst: string = 'testconsole.lpi'; - Pkg: array of string = ('PoweredBy', 'EyeCandyControls', 'splashabout', 'DCPcrypt'); + Pkg: array of string = (''); var Output, Line: ansistring; From 1d752f8edd41b490b518b11faa8347f807beb0be Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 13 Jan 2025 20:52:08 +0200 Subject: [PATCH 03/11] Rewrote CI to Pascal --- .github/workflows/make.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index 8917ee5..83e57d3 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -16,7 +16,7 @@ Src: string = 'Examples'; Use: string = 'Package'; Tst: string = 'testconsole.lpi'; - Pkg: array of string = (''); + Pkg: array of string = (); var Output, Line: ansistring; From 2bb8015dec2050010904cb7cc673d6b3419a0850 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 13 Jan 2025 21:19:52 +0200 Subject: [PATCH 04/11] fix github-actions --- .github/workflows/make.pas | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index 83e57d3..edcc86e 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -13,10 +13,10 @@ Process; const - Src: string = 'Examples'; - Use: string = 'Package'; + Src: string = 'demos'; + Use: string = '.'; Tst: string = 'testconsole.lpi'; - Pkg: array of string = (); + Pkg: array of string = ('BGRABitmap'); var Output, Line: ansistring; @@ -117,7 +117,7 @@ end else for Line in SplitString(Output, LineEnding) do - if Pos('Fatal', Line) <> 0 and Pos('Error', Line) then + if Pos('Fatal', Line) <> 0 or Pos('Error', Line) then Writeln(#27'[31m', Line, #27'[0m'); end; finally @@ -139,8 +139,11 @@ begin ExitCode += 1; for Line in SplitString(Output, LineEnding) do - if Pos('Fatal', Line) <> 0 and Pos('Error', Line) then - Writeln(#27'[31m', Line, #27'[0m'); + if Pos('Fatal:', Line) <> 0 or Pos('Error:', Line) then + begin + WriteLn(); + Writeln(#27'[31m', Line, #27'[0m'); + end; end; end; finally From 451963dd674cc40794db66bf40b140859ec37b28 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Mon, 13 Jan 2025 21:23:41 +0200 Subject: [PATCH 05/11] Rewrote CI to Pascal --- .github/workflows/make.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index edcc86e..56bce0a 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -14,9 +14,9 @@ const Src: string = 'demos'; - Use: string = '.'; + Use: string = 'Package'; Tst: string = 'testconsole.lpi'; - Pkg: array of string = ('BGRABitmap'); + Pkg: array of string = (); var Output, Line: ansistring; From 52af45de2b00733cd49d2706a454cb9db1e35742 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Tue, 14 Jan 2025 22:08:34 +0200 Subject: [PATCH 06/11] fix github-actions --- .github/workflows/make.pas | 263 +++++++++++++++++++++++-------------- .github/workflows/make.yml | 2 +- 2 files changed, 164 insertions(+), 101 deletions(-) diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index 56bce0a..c90f4e5 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -8,145 +8,208 @@ FileUtil, Zipper, fphttpclient, + RegExpr, openssl, opensslsockets, Process; const - Src: string = 'demos'; + Src: string = 'Examples'; Use: string = 'Package'; Tst: string = 'testconsole.lpi'; Pkg: array of string = (); +type + Output = record + Code: integer; + Output: ansistring; + end; + var - Output, Line: ansistring; - List: TStringList; Each, Item, PackagePath, TempFile, Url: string; + Line: ansistring; + Answer: Output; + List: TStringList; Zip: TStream; -begin - InitSSLInterface; - if FileExists('.gitmodules') then - if RunCommand('git', ['submodule', 'update', '--init', '--recursive', - '--force', '--remote'], Output) then - Writeln(#27'[33m', Output, #27'[0m') - else - begin - ExitCode += 1; - Writeln(#27'[31m', Output, #27'[0m'); - end; - List := FindAllFiles(Use, '*.lpk', True); - try - for Each in List do - if RunCommand('lazbuild', ['--add-package-link', Each], Output) then - Writeln(#27'[33m', 'added ', Each, #27'[0m') + procedure CheckModules; + begin + if FileExists('.gitmodules') then + if RunCommand('git', ['submodule', 'update', '--init', '--recursive', + '--force', '--remote'], Answer.Output) then + Writeln(stderr, #27'[33m', Answer.Output, #27'[0m') else begin ExitCode += 1; - Writeln(#27'[31m', 'added ', Each, #27'[0m'); + Writeln(stderr, #27'[31m', Answer.Output, #27'[0m'); end; - finally - List.Free; end; - for Each in Pkg do + + procedure AddPackage(Path: string); begin - PackagePath := GetEnvironmentVariable('HOME') + - '/.lazarus/onlinepackagemanager/packages/' + Each; - TempFile := GetTempFileName; - Url := 'https://packages.lazarus-ide.org/' + Each + '.zip'; - if not DirectoryExists(PackagePath) then - begin - Zip := TFileStream.Create(TempFile, fmCreate or fmOpenWrite); - with TFPHttpClient.Create(nil) do - begin - try - AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); - AllowRedirect := True; - Get(Url, Zip); - WriteLn('Download from ', Url, ' to ', TempFile); - finally - Free; + List := FindAllFiles(Use, '*.lpk', True); + try + for Each in List do + if RunCommand('lazbuild', ['--add-package-link', Each], Answer.Output) then + Writeln(stderr, #27'[33m', 'added ', Each, #27'[0m') + else + begin + ExitCode += 1; + Writeln(stderr, #27'[31m', 'added ', Each, #27'[0m'); end; - end; - Zip.Free; - CreateDir(PackagePath); - with TUnZipper.Create do + finally + List.Free; + end; + end; + + procedure AddOPM; + begin + InitSSLInterface; + for Each in Pkg do + begin + PackagePath := + {$IFDEF MSWINDOWS} + GetEnvironmentVariable('APPDATA') + '\.lazarus\onlinepackagemanager\packages\' + {$ELSE} + GetEnvironmentVariable('HOME') + '/.lazarus/onlinepackagemanager/packages/' + {$ENDIF} + + Each; + TempFile := GetTempFileName; + Url := 'https://packages.lazarus-ide.org/' + Each + '.zip'; + if not DirectoryExists(PackagePath) then begin - try - FileName := TempFile; - OutputPath := PackagePath; - Examine; - UnZipAllFiles; - WriteLn('Unzip from ', TempFile, ' to ', PackagePath); - finally - Free; + Zip := TFileStream.Create(TempFile, fmCreate or fmOpenWrite); + with TFPHttpClient.Create(nil) do + begin + try + AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); + AllowRedirect := True; + Get(Url, Zip); + WriteLn(stderr, 'Download from ', Url, ' to ', TempFile); + finally + Free; + end; end; - end; - DeleteFile(TempFile); - List := FindAllFiles(PackagePath, '*.lpk', True); - try - for Item in List do - if RunCommand('lazbuild', ['--add-package-link', Item], Output) then - Writeln(#27'[33m', 'added ', Item, #27'[0m') - else - begin - ExitCode += 1; - Writeln(#27'[31m', 'added ', Item, #27'[0m'); + Zip.Free; + CreateDir(PackagePath); + with TUnZipper.Create do + begin + try + FileName := TempFile; + OutputPath := PackagePath; + Examine; + UnZipAllFiles; + WriteLn(stderr, 'Unzip from ', TempFile, ' to ', PackagePath); + finally + Free; end; - finally - List.Free; + end; + DeleteFile(TempFile); + AddPackage(PackagePath); end; end; end; - List := FindAllFiles('.', Tst, True); - try - for Each in List do - begin - Writeln(#27'[33m', 'build ', Each, #27'[0m'); + + procedure BuildProject(Path: string); + begin + Write(stderr, #27'[33m', 'build from ', Each, #27'[0m'); + try if RunCommand('lazbuild', ['--build-all', '--recursive', - '--no-write-project', Each], Output) then - for Line in SplitString(Output, LineEnding) do + '--no-write-project', Each], Answer.Output) then + Answer.Code := 0 + else + begin + Answer.Code := 1; + ExitCode += Answer.Code; + end; + except + on E: Exception do + WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); + end; + end; + + procedure RunTest; + begin + List := FindAllFiles('.', Tst, True); + try + for Each in List do + begin + BuildProject(Each); + if Answer.Code <> 0 then begin - if Pos('Linking', Line) <> 0 then - begin - if not RunCommand('command', [SplitString(Line, ' ')[2], - '--all', '--format=plain', '--progress'], Output) then - ExitCode += 1; - WriteLn(Output); - end; + for Line in SplitString(Answer.Output, LineEnding) do + with TRegExpr.Create do + begin + Expression := '(Fatal|Error):'; + if Exec(Line) then + begin + WriteLn(stderr); + Writeln(stderr, #27'[31m', Line, #27'[0m'); + end; + Free; + end; end - else - for Line in SplitString(Output, LineEnding) do - if Pos('Fatal', Line) <> 0 or Pos('Error', Line) then - Writeln(#27'[31m', Line, #27'[0m'); + else + for Line in SplitString(Answer.Output, LineEnding) do + if Pos('Linking', Line) <> 0 then + try + begin + Writeln(stderr, #27'[32m', ' to ', SplitString(Line, ' ')[2], #27'[0m'); + if not RunCommand(ReplaceStr(SplitString(Line, ' ')[2], + SplitString(Tst, '.')[0], './' + SplitString(Tst, '.')[0]), + ['--all', '--format=plain', '--progress'], Answer.Output) then + ExitCode += 1; + WriteLn(stderr, Answer.Output); + break; + end; + except + on E: Exception do + WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); + end; + end; + finally + List.Free; end; - finally - List.Free; end; + +begin + CheckModules; + AddPackage(Use); + AddOPM; + {$IFDEF LINUX} + RunTest; + {$ENDIF} List := FindAllFiles(Src, '*.lpi', True); try for Each in List do - begin - Write(#27'[33m', 'build from ', Each, #27'[0m'); - if RunCommand('lazbuild', ['--build-all', '--recursive', - '--no-write-project', Each], Output) then - for Line in SplitString(Output, LineEnding) do - begin - if Pos('Linking', Line) <> 0 then - Writeln(#27'[32m', ' to ', SplitString(Line, ' ')[2], #27'[0m'); - end - else + if Pos(Tst, Each) = 0 then begin - ExitCode += 1; - for Line in SplitString(Output, LineEnding) do - if Pos('Fatal:', Line) <> 0 or Pos('Error:', Line) then + BuildProject(Each); + if Answer.Code <> 0 then + begin + for Line in SplitString(Answer.Output, LineEnding) do + with TRegExpr.Create do begin - WriteLn(); - Writeln(#27'[31m', Line, #27'[0m'); + Expression := '(Fatal|Error):'; + if Exec(Line) then + begin + WriteLn(stderr); + Writeln(stderr, #27'[31m', Line, #27'[0m'); + end; + Free; end; + end + else + for Line in SplitString(Answer.Output, LineEnding) do + if Pos('Linking', Line) <> 0 then + Writeln(stderr, #27'[32m', ' to ', SplitString(Line, ' ')[2], #27'[0m'); end; - end; finally List.Free; end; + WriteLn(stderr); + if ExitCode <> 0 then + WriteLn(stderr, #27'[31m', 'Errors: ', ExitCode, #27'[0m') + else + WriteLn(stderr, #27'[32m', 'Errors: ', ExitCode, #27'[0m'); end. diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index a90dc85..b469b76 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -34,4 +34,4 @@ jobs: shell: bash run: | sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null - instantfpc "-Fu/usr/lib/lazarus/3.0/components/lazutils" .github/workflows/make.pas + instantfpc -Fu/usr/lib/lazarus/*/components/lazutils .github/workflows/make.pas From 65d4c311ae2c8fe04f6f759539af792601e4f489 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Wed, 15 Jan 2025 15:49:46 +0200 Subject: [PATCH 07/11] fix github-actions --- .github/workflows/make.pas | 299 +++++++++++++++++-------------------- 1 file changed, 141 insertions(+), 158 deletions(-) diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index c90f4e5..655b1f9 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -14,202 +14,185 @@ Process; const - Src: string = 'Examples'; - Use: string = 'Package'; - Tst: string = 'testconsole.lpi'; - Pkg: array of string = (); + Target: string = 'Examples'; + Dependencies: array of string = (); type Output = record - Code: integer; + Code: boolean; Output: ansistring; end; -var - Each, Item, PackagePath, TempFile, Url: string; - Line: ansistring; - Answer: Output; - List: TStringList; - Zip: TStream; - - procedure CheckModules; + function CheckModules: Output; begin if FileExists('.gitmodules') then if RunCommand('git', ['submodule', 'update', '--init', '--recursive', - '--force', '--remote'], Answer.Output) then - Writeln(stderr, #27'[33m', Answer.Output, #27'[0m') - else - begin - ExitCode += 1; - Writeln(stderr, #27'[31m', Answer.Output, #27'[0m'); - end; + '--force', '--remote'], Result.Output) then + Writeln(stderr, #27'[33m', Result.Output, #27'[0m'); end; - procedure AddPackage(Path: string); + function AddPackage(Path: string): Output; begin - List := FindAllFiles(Use, '*.lpk', True); - try - for Each in List do - if RunCommand('lazbuild', ['--add-package-link', Each], Answer.Output) then - Writeln(stderr, #27'[33m', 'added ', Each, #27'[0m') - else - begin - ExitCode += 1; - Writeln(stderr, #27'[31m', 'added ', Each, #27'[0m'); - end; - finally - List.Free; + with TRegExpr.Create do + begin + Expression := + {$IFDEF MSWINDOWS} + '(cocoa|x11|_template)' + {$ELSE} + '(cocoa|gdi|_template)' + {$ENDIF} + ; + if not Exec(Path) and RunCommand('lazbuild', ['--add-package-link', Path], + Result.Output) then + Writeln(stderr, #27'[33m', 'added ', Path, #27'[0m'); + Free; end; end; - procedure AddOPM; + function BuildProject(Path: string): Output; + var + Line: string; begin - InitSSLInterface; - for Each in Pkg do - begin - PackagePath := - {$IFDEF MSWINDOWS} - GetEnvironmentVariable('APPDATA') + '\.lazarus\onlinepackagemanager\packages\' - {$ELSE} - GetEnvironmentVariable('HOME') + '/.lazarus/onlinepackagemanager/packages/' - {$ENDIF} - + Each; - TempFile := GetTempFileName; - Url := 'https://packages.lazarus-ide.org/' + Each + '.zip'; - if not DirectoryExists(PackagePath) then - begin - Zip := TFileStream.Create(TempFile, fmCreate or fmOpenWrite); - with TFPHttpClient.Create(nil) do + Write(stderr, #27'[33m', 'build from ', Path, #27'[0m'); + try + Result.Code := RunCommand('lazbuild', ['--build-all', '--recursive', + '--no-write-project', Path], Result.Output); + if Result.Code then + for Line in SplitString(Result.Output, LineEnding) do begin - try - AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); - AllowRedirect := True; - Get(Url, Zip); - WriteLn(stderr, 'Download from ', Url, ' to ', TempFile); - finally - Free; + if ContainsStr(Line, 'Linking') then + begin + Result.Output := SplitString(Line, ' ')[2]; + Writeln(stderr, #27'[32m', ' to ', Result.Output, #27'[0m'); + break; end; - end; - Zip.Free; - CreateDir(PackagePath); - with TUnZipper.Create do - begin - try - FileName := TempFile; - OutputPath := PackagePath; - Examine; - UnZipAllFiles; - WriteLn(stderr, 'Unzip from ', TempFile, ' to ', PackagePath); - finally + end + else + begin + ExitCode += 1; + for Line in SplitString(Result.Output, LineEnding) do + with TRegExpr.Create do + begin + Expression := '(Fatal|Error):'; + if Exec(Line) then + begin + WriteLn(stderr); + Writeln(stderr, #27'[31m', Line, #27'[0m'); + end; Free; end; - end; - DeleteFile(TempFile); - AddPackage(PackagePath); end; + except + on E: Exception do + WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); end; end; - procedure BuildProject(Path: string); + function RunTest(Path: string): Output; + var + Temp: string; begin - Write(stderr, #27'[33m', 'build from ', Each, #27'[0m'); - try - if RunCommand('lazbuild', ['--build-all', '--recursive', - '--no-write-project', Each], Answer.Output) then - Answer.Code := 0 - else + Result := BuildProject(Path); + Temp:= Result.Output; + if Result.Code then + try + if not RunCommand(Temp, ['--all', '--format=plain', '--progress'], Result.Output) then + ExitCode += 1; + WriteLn(stderr, Result.Output); + except + on E: Exception do + WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); + end; + end; + + function AddOPM(Each: string): string; + var + TempFile, Url: string; + Zip: TStream; + begin + Result := + {$IFDEF MSWINDOWS} + GetEnvironmentVariable('APPDATA') + '\.lazarus\onlinepackagemanager\packages\' + {$ELSE} + GetEnvironmentVariable('HOME') + '/.lazarus/onlinepackagemanager/packages/' + {$ENDIF} + + Each; + TempFile := GetTempFileName; + Url := 'https://packages.lazarus-ide.org/' + Each + '.zip'; + if not DirectoryExists(Result) then + begin + Zip := TFileStream.Create(TempFile, fmCreate or fmOpenWrite); + with TFPHttpClient.Create(nil) do begin - Answer.Code := 1; - ExitCode += Answer.Code; + try + AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); + AllowRedirect := True; + Get(Url, Zip); + WriteLn(stderr, 'Download from ', Url, ' to ', TempFile); + finally + Free; + end; end; - except - on E: Exception do - WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); + Zip.Free; + CreateDir(Result); + with TUnZipper.Create do + begin + try + FileName := TempFile; + OutputPath := Result; + Examine; + UnZipAllFiles; + WriteLn(stderr, 'Unzip from ', TempFile, ' to ', Result); + finally + Free; + end; + end; + DeleteFile(TempFile); end; end; - procedure RunTest; + function Main: Output; + var + Each, Item: string; + List: TStringList; begin - List := FindAllFiles('.', Tst, True); + CheckModules; + InitSSLInterface; + for Each in Dependencies do + begin + List := FindAllFiles(AddOPM(Each), '*.lpk', True); + try + for Item in List do + AddPackage(Item); + finally + List.Free; + end; + end; + List := FindAllFiles('.', '*.lpk', True); try for Each in List do - begin - BuildProject(Each); - if Answer.Code <> 0 then - begin - for Line in SplitString(Answer.Output, LineEnding) do - with TRegExpr.Create do - begin - Expression := '(Fatal|Error):'; - if Exec(Line) then - begin - WriteLn(stderr); - Writeln(stderr, #27'[31m', Line, #27'[0m'); - end; - Free; - end; - end + AddPackage(Each); + finally + List.Free; + end; + List := FindAllFiles(Target, '*.lpi', True); + try + for Each in List do + if ContainsStr(ReadFileToString(ReplaceStr(Each, '.lpi', '.lpr')), + 'consoletestrunner') then + RunTest(Each) else - for Line in SplitString(Answer.Output, LineEnding) do - if Pos('Linking', Line) <> 0 then - try - begin - Writeln(stderr, #27'[32m', ' to ', SplitString(Line, ' ')[2], #27'[0m'); - if not RunCommand(ReplaceStr(SplitString(Line, ' ')[2], - SplitString(Tst, '.')[0], './' + SplitString(Tst, '.')[0]), - ['--all', '--format=plain', '--progress'], Answer.Output) then - ExitCode += 1; - WriteLn(stderr, Answer.Output); - break; - end; - except - on E: Exception do - WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); - end; - end; + BuildProject(Each); finally List.Free; end; + WriteLn(stderr); + if ExitCode <> 0 then + WriteLn(stderr, #27'[31m', 'Errors: ', ExitCode, #27'[0m') + else + WriteLn(stderr, #27'[32m', 'Errors: ', ExitCode, #27'[0m'); end; begin - CheckModules; - AddPackage(Use); - AddOPM; - {$IFDEF LINUX} - RunTest; - {$ENDIF} - List := FindAllFiles(Src, '*.lpi', True); - try - for Each in List do - if Pos(Tst, Each) = 0 then - begin - BuildProject(Each); - if Answer.Code <> 0 then - begin - for Line in SplitString(Answer.Output, LineEnding) do - with TRegExpr.Create do - begin - Expression := '(Fatal|Error):'; - if Exec(Line) then - begin - WriteLn(stderr); - Writeln(stderr, #27'[31m', Line, #27'[0m'); - end; - Free; - end; - end - else - for Line in SplitString(Answer.Output, LineEnding) do - if Pos('Linking', Line) <> 0 then - Writeln(stderr, #27'[32m', ' to ', SplitString(Line, ' ')[2], #27'[0m'); - end; - finally - List.Free; - end; - WriteLn(stderr); - if ExitCode <> 0 then - WriteLn(stderr, #27'[31m', 'Errors: ', ExitCode, #27'[0m') - else - WriteLn(stderr, #27'[32m', 'Errors: ', ExitCode, #27'[0m'); + Main; end. From 7456f2e9c03f69d4c37cf690b4c8fa37e755d678 Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Sat, 18 Jan 2025 22:08:52 +0200 Subject: [PATCH 08/11] add libsagui --- .github/workflows/make.pas | 247 ++++++++++++++++++------------------- .github/workflows/make.yml | 19 ++- .gitmodules | 3 + libsagui | 1 + 4 files changed, 138 insertions(+), 132 deletions(-) create mode 100644 .gitmodules create mode 160000 libsagui diff --git a/.github/workflows/make.pas b/.github/workflows/make.pas index 655b1f9..5ed98d8 100644 --- a/.github/workflows/make.pas +++ b/.github/workflows/make.pas @@ -14,101 +14,128 @@ Process; const - Target: string = 'Examples'; + Target: string = '.'; Dependencies: array of string = (); type + TLog = (audit, info, error); + Output = record - Code: boolean; - Output: ansistring; + Success: boolean; + Output: string; end; - function CheckModules: Output; + procedure OutLog(const Knd: TLog; const Msg: string); + begin + case Knd of + error: Writeln(stderr, #27'[31m', Msg, #27'[0m'); + info: Writeln(stderr, #27'[32m', Msg, #27'[0m'); + audit: Writeln(stderr, #27'[33m', Msg, #27'[0m'); + end; + end; + + function CheckModules: string; begin if FileExists('.gitmodules') then if RunCommand('git', ['submodule', 'update', '--init', '--recursive', - '--force', '--remote'], Result.Output) then - Writeln(stderr, #27'[33m', Result.Output, #27'[0m'); + '--force', '--remote'], Result) then + OutLog(info, Result) + else + OutLog(error, Result); end; - function AddPackage(Path: string): Output; + function AddPackage(const Path: string): string; begin - with TRegExpr.Create do - begin - Expression := - {$IFDEF MSWINDOWS} - '(cocoa|x11|_template)' - {$ELSE} - '(cocoa|gdi|_template)' - {$ENDIF} - ; - if not Exec(Path) and RunCommand('lazbuild', ['--add-package-link', Path], - Result.Output) then - Writeln(stderr, #27'[33m', 'added ', Path, #27'[0m'); - Free; - end; + if RunCommand('lazbuild', ['--add-package-link', Path], Result) then + OutLog(audit, 'Add package:'#9 + Path); end; - function BuildProject(Path: string): Output; + function SelectString(const Input, Reg: string): string; var Line: string; begin - Write(stderr, #27'[33m', 'build from ', Path, #27'[0m'); - try - Result.Code := RunCommand('lazbuild', ['--build-all', '--recursive', - '--no-write-project', Path], Result.Output); - if Result.Code then - for Line in SplitString(Result.Output, LineEnding) do - begin - if ContainsStr(Line, 'Linking') then - begin - Result.Output := SplitString(Line, ' ')[2]; - Writeln(stderr, #27'[32m', ' to ', Result.Output, #27'[0m'); - break; - end; - end - else + Result := ' '; + for Line in Input.Split(LineEnding) do + with TRegExpr.Create do begin - ExitCode += 1; - for Line in SplitString(Result.Output, LineEnding) do - with TRegExpr.Create do - begin - Expression := '(Fatal|Error):'; - if Exec(Line) then - begin - WriteLn(stderr); - Writeln(stderr, #27'[31m', Line, #27'[0m'); - end; - Free; - end; + Expression := Reg; + if Exec(Line) then + Result += Line + LineEnding; + Free; end; - except - on E: Exception do - WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); + end; + + function RunTest(const Path: String): string; + begin + OutLog(audit, #9'run:'#9 + Path); + if RunCommand(Path, ['--all', '--format=plain'], Result) then + OutLog(info, #9'success!') + else + begin + ExitCode += 1; + OutLog(error, Result); end; end; - function RunTest(Path: string): Output; - var - Temp: string; + function BuildProject(const Path: string): Output; begin - Result := BuildProject(Path); - Temp:= Result.Output; - if Result.Code then - try - if not RunCommand(Temp, ['--all', '--format=plain', '--progress'], Result.Output) then - ExitCode += 1; - WriteLn(stderr, Result.Output); - except - on E: Exception do - WriteLn(stderr, 'Error: ' + E.ClassName + #13#10 + E.Message); - end; + OutLog(audit, 'Build from:'#9 + Path); + Result.Success := RunCommand('lazbuild', + ['--build-all', '--recursive', '--no-write-project', Path], Result.Output); + Result.Output := SelectString(Result.Output, '(Fatal:|Error:|Linking)'); + if Result.Success then + begin + Result.Output := Result.Output.Split(' ')[3].Replace(LineEnding, ''); + OutLog(info, #9'to:'#9 + Result.Output); + if ContainsStr(ReadFileToString(Path.Replace('.lpi', '.lpr')), 'consoletestrunner') then + RunTest(Result.Output.Replace(#10, '')); + end + else + begin + ExitCode += 1; + OutLog(error, Result.Output); + end; end; - function AddOPM(Each: string): string; + function DownloadFile(const Uri: string): string; var - TempFile, Url: string; - Zip: TStream; + OutFile: TStream; + begin + InitSSLInterface; + Result := GetTempFileName; + OutFile := TFileStream.Create(Result, fmCreate or fmOpenWrite); + with TFPHttpClient.Create(nil) do + begin + try + AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); + AllowRedirect := True; + Get(Uri, OutFile); + OutLog(audit, 'Download from ' + Uri + ' to ' + Result); + finally + Free; + OutFile.Free; + end; + end; + end; + + procedure UnZip(const ZipFile, ZipPath: string); + begin + with TUnZipper.Create do + begin + try + FileName := ZipFile; + OutputPath := ZipPath; + Examine; + UnZipAllFiles; + OutLog(audit, 'Unzip from'#9 + ZipFile + #9'to'#9 + ZipPath); + DeleteFile(ZipFile); + finally + Free; + end; + end; + end; + + function InstallOPM(const Path: string): string; begin Result := {$IFDEF MSWINDOWS} @@ -116,83 +143,43 @@ Output = record {$ELSE} GetEnvironmentVariable('HOME') + '/.lazarus/onlinepackagemanager/packages/' {$ENDIF} - + Each; - TempFile := GetTempFileName; - Url := 'https://packages.lazarus-ide.org/' + Each + '.zip'; + + Path; if not DirectoryExists(Result) then begin - Zip := TFileStream.Create(TempFile, fmCreate or fmOpenWrite); - with TFPHttpClient.Create(nil) do - begin - try - AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)'); - AllowRedirect := True; - Get(Url, Zip); - WriteLn(stderr, 'Download from ', Url, ' to ', TempFile); - finally - Free; - end; - end; - Zip.Free; CreateDir(Result); - with TUnZipper.Create do - begin - try - FileName := TempFile; - OutputPath := Result; - Examine; - UnZipAllFiles; - WriteLn(stderr, 'Unzip from ', TempFile, ' to ', Result); - finally - Free; - end; - end; - DeleteFile(TempFile); + UnZip(DownloadFile('https://packages.lazarus-ide.org/' + Path + '.zip'), Result); end; end; - function Main: Output; + function BuildAll: string; var - Each, Item: string; List: TStringList; begin CheckModules; - InitSSLInterface; - for Each in Dependencies do - begin - List := FindAllFiles(AddOPM(Each), '*.lpk', True); - try - for Item in List do - AddPackage(Item); - finally - List.Free; - end; - end; - List := FindAllFiles('.', '*.lpk', True); + List := FindAllFiles(GetCurrentDir, '*.lpk', True); try - for Each in List do - AddPackage(Each); + for Result in Dependencies do + List.AddStrings(FindAllFiles(InstallOPM(Result), '*.lpk', True)); + for Result in List do + AddPackage(Result); + List := FindAllFiles(Target, '*.lpi', True); + for Result in List do + BuildProject(Result); finally List.Free; end; - List := FindAllFiles(Target, '*.lpi', True); - try - for Each in List do - if ContainsStr(ReadFileToString(ReplaceStr(Each, '.lpi', '.lpr')), - 'consoletestrunner') then - RunTest(Each) - else - BuildProject(Each); - finally - List.Free; + case ExitCode of + 0: OutLog(info, 'Errors:'#9 + IntToStr(ExitCode)); + else + OutLog(error, 'Errors:'#9 + IntToStr(ExitCode)); end; - WriteLn(stderr); - if ExitCode <> 0 then - WriteLn(stderr, #27'[31m', 'Errors: ', ExitCode, #27'[0m') - else - WriteLn(stderr, #27'[32m', 'Errors: ', ExitCode, #27'[0m'); end; begin - Main; + try + BuildAll + except + on E: Exception do + Writeln(E.ClassName, #9, E.Message); + end; end. diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index b469b76..8206973 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -33,5 +33,20 @@ jobs: - name: Build shell: bash run: | - sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null - instantfpc -Fu/usr/lib/lazarus/*/components/lazutils .github/workflows/make.pas + set -xeuo pipefail + sudo bash -c ' + apt-get update + apt-get install -y lazarus lib{gnutls28,curl4-gnutls}-dev + ' >/dev/null + if pushd libsagui; then + cmake -B build \ + -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DSG_HTTPS_SUPPORT=ON + cmake --build build --config Debug + popd + fi + instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \ + -B '.github/workflows/make.pas' + if pushd Test; then + bash RunAllTests.sh + fi + diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..07a70cd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libsagui"] + path = libsagui + url = git@github.com:risoflora/libsagui.git diff --git a/libsagui b/libsagui new file mode 160000 index 0000000..4605b6a --- /dev/null +++ b/libsagui @@ -0,0 +1 @@ +Subproject commit 4605b6abdd17ccb6e7ec3aa82ab109d65f4abcae From d4d0d85929897c455b5e3da782b83fb6251d17ae Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Sat, 18 Jan 2025 22:40:32 +0200 Subject: [PATCH 09/11] add run test to ci --- .github/workflows/make.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 8206973..b18f27c 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -42,11 +42,10 @@ jobs: cmake -B build \ -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DSG_HTTPS_SUPPORT=ON cmake --build build --config Debug - popd - fi - instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \ - -B '.github/workflows/make.pas' - if pushd Test; then - bash RunAllTests.sh + if popd; then + instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \ + -B '.github/workflows/make.pas' || true + pushd Test && bash RunAllTests.sh + fi fi From d3462b4974cee68e69708b6f6d61a8a856c6465e Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Sat, 18 Jan 2025 23:09:56 +0200 Subject: [PATCH 10/11] fix github-actions --- .github/workflows/make.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index b18f27c..0129ae0 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -38,10 +38,10 @@ jobs: apt-get update apt-get install -y lazarus lib{gnutls28,curl4-gnutls}-dev ' >/dev/null - if pushd libsagui; then - cmake -B build \ - -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DSG_HTTPS_SUPPORT=ON - cmake --build build --config Debug + mkdir -p libsagui/build + if pushd libsagui/build; then + cmake -DCMAKE_C_COMPILER=clang .. + make && sudo make sagui install/strip && sudo ldconfig if popd; then instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \ -B '.github/workflows/make.pas' || true From b83e3482733c81a7bd3b979a197f62ac7209fcbd Mon Sep 17 00:00:00 2001 From: "Artem V. Ageev" Date: Sat, 18 Jan 2025 23:25:25 +0200 Subject: [PATCH 11/11] add unittest --- .github/workflows/make.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 0129ae0..e7ed91d 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -44,7 +44,7 @@ jobs: make && sudo make sagui install/strip && sudo ldconfig if popd; then instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \ - -B '.github/workflows/make.pas' || true + -B '.github/workflows/make.pas' pushd Test && bash RunAllTests.sh fi fi