Skip to content

[3/3] Add GitHub Actions CI with build and test automation#282

Merged
irodushka merged 1 commit intoFirebirdSQL:masterfrom
fdcastel:new-github-actions
Apr 6, 2026
Merged

[3/3] Add GitHub Actions CI with build and test automation#282
irodushka merged 1 commit intoFirebirdSQL:masterfrom
fdcastel:new-github-actions

Conversation

@fdcastel
Copy link
Copy Markdown
Member

@fdcastel fdcastel commented Mar 31, 2026

This is the third and last part of planned PRs aimed at improving the project infrastructure, as outlined in the plan discussed in PR #275.

Summary

Add a unified Build and Test workflow that automates building the driver and running the full test suite on every push and PR. This replaces the existing Linux-only workflow and the Raspberry Pi workflow with a cross-platform CI pipeline that uses PowerShell (Invoke-Build) and PSFirebird for consistent orchestration on both Windows and Linux.

What this PR does

New: build-and-test.yml workflow

  • Builds the driver with CMake (Release, x64) on Windows and Linux
  • Downloads and configures Firebird 5.0.2 via the PSFirebird module
  • Creates test databases (UTF-8 and ISO-8859-1 charsets)
  • Registers the ODBC driver on the system
  • Runs the test suite with three charset configurations:
    1. UTF-8 database with UTF-8 charset (full suite)
    2. ISO-8859-1 database with ISO-8859-1 charset (charset-sensitive suites)
    3. ISO-8859-1 database with UTF-8 charset (charset-sensitive suites)
  • Uploads built driver artifacts

New: firebird-odbc-driver.build.ps1 (Invoke-Build script)

Cross-platform build script with tasks: clean, build, build-test-databases, install, uninstall, test. Works identically on Windows and Linux. Can be used locally:

./install-prerequisites.ps1
Invoke-Build test -Configuration Release

New: install-prerequisites.ps1

Installs required PowerShell modules (PSFirebird, InvokeBuild).

Fix: FirebirdODBC.dll.manifest

Changed processorArchitecture from X86 to * (wildcard). The old value caused DLL loading failures (system error 193) on x64 and ARM64 builds because the embedded manifest requested x86 Common Controls, triggering a SxS architecture mismatch.

Removed workflows

  • linux.yml — superseded by the new build-and-test.yml
  • rpi_arm64.yml — niche target; Linux CI covers this platform

Kept workflows

  • msbuild.yml — VS 2022 solution build (Win32 + x64 + installers)
  • msbuild_arm64.yaml — VS 2022 ARM64 build
  • Cleaned up temporary branch names from push triggers in both

Test results

Both Windows and Linux CI jobs pass with identical results:

  • 375 tests discovered (via gtest_discover_tests)
  • 230 passed, 145 skipped, 0 failed
  • Three charset configuration runs all pass

Local and CI results match.

@fdcastel fdcastel changed the title Add GitHub Actions CI with build and test automation [3/3] Add GitHub Actions CI with build and test automation Mar 31, 2026
@irodushka
Copy link
Copy Markdown
Contributor

Hi @fdcastel

Let's start our conversation again)

What is firebird-odbc-driver.build.ps1? Why not just use the cmake command?
Do I understand right that the ps1 extension means - powershell script? If yes - what is the reason to run it on Linux?

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 1, 2026

What is firebird-odbc-driver.build.ps1?

It’s essentially a build script -- similar to a makefile -- but written in PowerShell (using tools like Invoke-Build).

We use a similar script system for Firebird Docker images.

Why not just use the cmake command?

In many cases, a shell script is simpler to read and maintain.

It also allows you to reuse existing PowerShell modules (like PSFirebird or the above cited Invoke-Build) instead of reimplementing functionality from scratch.

Do I understand right that the ps1 extension means - powershell script?

Correct.

If yes - what is the reason to run it on Linux?

Because -- aside from the benefits mentioned above -- PowerShell has been running on Linux for more than 10 years now 😉

@fdcastel fdcastel force-pushed the new-github-actions branch from ca590f0 to 2fc2359 Compare April 1, 2026 12:18
Add a unified build-and-test workflow using PowerShell (Invoke-Build) and
PSFirebird for cross-platform CI on Windows and Linux:

- Build the driver with CMake (Release, x64)
- Download and configure Firebird 5.0.2 via PSFirebird module
- Create test databases (UTF-8 and ISO-8859-1)
- Register the ODBC driver
- Run the full test suite with three charset configurations

Also:
- Fix processorArchitecture in DLL manifest from X86 to wildcard (*)
  so the driver loads correctly on x64 and ARM64 builds
- Remove linux.yml (superseded by build-and-test.yml)
- Remove rpi_arm64.yml (niche; Linux CI covers this)
- Clean up temporary branch names from msbuild workflow triggers
@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 1, 2026

Improved the README section on building the project.

@irodushka
Copy link
Copy Markdown
Contributor

@fdcastel
sorry for delay again. Forgot to press the "Comment" button last Friday)

So if these ps1 scripts should be used for CI only, it's no problem here) and yes, I'm an oldschool geezer, you've guessed right!))

Just the last (I hope) question - what about the installers? We have the InnoSetup for MSBuild now - I agree it's ugly and buggy and have a big problem with Windows antivirus, but it's better than nothing. As far as I remember you mentioned some other more modern approarch for the installer software, so where is it and when should we except it to appear?)

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

So if these ps1 scripts should be used for CI only, it's no problem here) and yes, I'm an oldschool geezer, you've guessed right!))

Sure, it’s optional. Feel free to stick with whatever BASH flavor makes your terminal feel like home 😉

As far as I remember you mentioned some other more modern approarch for the installer software, so where is it and when should we except it to appear?)

Ah, yes, the WiX installer! It’s included in vNext.

It didn't show up here because I was simply following the plan.

But if you’d like it included in this PR (or any other feature from the other fork), I can bring it over. No problem! Just let me know.

@irodushka
Copy link
Copy Markdown
Contributor

But if you’d like it included in this PR (or any other feature from the other fork), I can bring it over. No problem! Just let me know.

Np to merge it as is, and I gonna do it now.
Maybe it makes sense to make a separate PR with the WiX installer - right after this one.

@irodushka irodushka merged commit 595ba16 into FirebirdSQL:master Apr 6, 2026
4 checks passed
@irodushka
Copy link
Copy Markdown
Contributor

@fdcastel

https://github.com/FirebirdSQL/firebird-odbc-driver/actions/runs/24034920090/job/70092000216

Invoke-RestMethod: C:\Users\runneradmin\Documents\PowerShell\Modules\PSFirebird\0.5.0\Private\Get-FirebirdReleaseUrl.ps1:50
Line |
  50 |  … $releases = Invoke-RestMethod -Uri $apiUrl -Headers $headers -Verbose …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     |  {   "message": "API rate limit exceeded for 172.203.212.193. (But here\u0027s the good news: Authenticated
     | requests get a higher rate limit. Check out the documentation for more details.)",   "documentation_url":
     | "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting" }
Error: Process completed with exit code 1.

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

@irodushka

Np to merge it as is, and I gonna do it now.

Great! 🎉 This closes our initial plan from #275.

Now, please, investigate which parts from #283 should we migrate next?.

It would probably make sense to begin with the most critical issues listed in section 1 of this document. They’re roughly organized in the same order I’ve been tackling the tasks.

(suggestion: You may open new issues here on GitHub an assign them to me, if you prefer)

Maybe it makes sense to make a separate PR with the WiX installer - right after this one.

Working on it. (curiously, this was one change that ended not being in the plan)

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

Line |
50 | … $releases = Invoke-RestMethod -Uri $apiUrl -Headers $headers -Verbose …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| { "message": "API rate limit exceeded for 172.203.212.193. (But here\u0027s the good news: Authenticated
| requests get a higher rate limit. Check out the documentation for more details.)", "documentation_url":
| "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting" }
Error: Process completed with exit code 1.

@irodushka I’ll look into it. GitHub enforces a low rate limit for unauthenticated requests.

@irodushka
Copy link
Copy Markdown
Contributor

irodushka commented Apr 6, 2026

I suppose we should add smth like

          --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \

to firebird_headers cmake macro?..

P.S. Nope. The error occures after build while executing C:\Users\runneradmin\Documents\PowerShell\Modules\PSFirebird\0.5.0\Private\Get-FirebirdReleaseUrl.ps1

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

I suppose we should add smth like

          --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \

Almost that.

Yes, we do need to set it. But as an API_GITHUB_ACCESS_TOKEN environment variable.

If this env var is defined, the PSFirebird code that makes the GitHub request will automatically use it.

I’ll update the PSFirebird documentation to alert to this fact.

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

Fixed in #285.

@irodushka
Copy link
Copy Markdown
Contributor

@fdcastel

The prev issue is fixed, true.
But we've lost the linux-arm64 and win32 builds. Smth not good with that os matrix.

libOdbcFb.so looks big, maybe it's not stripped?..

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

Lets continue this on #286

@fdcastel
Copy link
Copy Markdown
Member Author

fdcastel commented Apr 6, 2026

@irodushka

Now, please, investigate which parts from #283 should we migrate next?.

Initial suggestion in #287.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants