Skip to content

Commit 2fc2359

Browse files
committed
Add GitHub Actions CI with full build and test automation
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
1 parent 8e64f5e commit 2fc2359

9 files changed

Lines changed: 411 additions & 96 deletions
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build-and-test:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- os: windows-latest
19+
- os: ubuntu-22.04
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # Full history for git-tag-based versioning
27+
28+
- name: Install prerequisites
29+
shell: pwsh
30+
run: ./install-prerequisites.ps1
31+
32+
- name: Install unixODBC (Linux)
33+
if: runner.os == 'Linux'
34+
run: sudo apt-get update && sudo apt-get install -y unixodbc unixodbc-dev
35+
36+
- name: Build, install and test
37+
shell: pwsh
38+
run: Invoke-Build test -Configuration Release -File ./firebird-odbc-driver.build.ps1
39+
40+
- name: Upload driver (Windows)
41+
if: runner.os == 'Windows'
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: FirebirdODBC-windows-x64
45+
path: build/Release/FirebirdODBC.dll
46+
47+
- name: Upload driver (Linux)
48+
if: runner.os == 'Linux'
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: FirebirdODBC-linux-x64
52+
path: build/libOdbcFb.so

.github/workflows/linux.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/msbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ name: MSBuild
77

88
on:
99
push:
10-
branches: [ "master", "new-build-system", "new-build-system-no-pr" ]
10+
branches: [master]
1111
pull_request:
12-
branches: [ "master" ]
12+
branches: [master]
1313

1414
env:
1515
# Path to the solution file relative to the root of the project.

.github/workflows/msbuild_arm64.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ name: MSBuild_ARM64
77

88
on:
99
push:
10-
branches: [ "master", "new-build-system", "new-build-system-no-pr" ]
10+
branches: [master]
1111
pull_request:
12-
branches: [ "master" ]
12+
branches: [master]
1313

1414
env:
1515
# Path to the solution file relative to the root of the project.

.github/workflows/rpi_arm64.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

FirebirdODBC.dll.manifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
33
<assemblyIdentity
44
version="1.0.0.0"
5-
processorArchitecture="X86"
5+
processorArchitecture="*"
66
name="Firebird OdbcJdbc driver"
77
type="win32"
88
/>
@@ -13,7 +13,7 @@
1313
type="win32"
1414
name="Microsoft.Windows.Common-Controls"
1515
version="6.0.0.0"
16-
processorArchitecture="X86"
16+
processorArchitecture="*"
1717
publicKeyToken="6595b64144ccf1df"
1818
language="*"
1919
/>

README.md

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ All the new features and fixes are documented here -
1818

1919
The latest build artifacts:
2020
* [Windows installation package](https://github.com/user-attachments/files/19207749/win_installers.zip) [![MSBuild](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/msbuild.yml/badge.svg)](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/msbuild.yml)
21-
* [Linux x86-64](https://github.com/user-attachments/files/19207739/linux_libs.zip) [![Linux](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/linux.yml/badge.svg)](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/linux.yml)
22-
* [Linux_ARM64](https://github.com/user-attachments/files/19210460/linux_arm64_libs.zip) [![RaspberryPI](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/rpi_arm64.yml/badge.svg)](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/rpi_arm64.yml)
21+
22+
[![Build and Test](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/FirebirdSQL/firebird-odbc-driver/actions/workflows/build-and-test.yml)
2323

2424
You can also download the lastest & archive build packages here: https://github.com/FirebirdSQL/firebird-odbc-driver/wiki
2525

@@ -108,21 +108,53 @@ Identifier handling options:
108108

109109
## Build from sources
110110

111-
### Linux
112-
* Clone the git repository into your working copy folder
113-
* Make sure you have Unix ODBC dev package installed. If not - install it (for example: `sudo apt install unixodbc-dev` for Ubuntu)
114-
* Move to Builds/Gcc.lin
115-
* Rename makefile.linux -> makefile
116-
* Set the DEBUG var if you need a Debug build instead of Release (by default)
117-
* Run `make`
118-
* Your libraries are in ./Release_<arch> or ./Debug_<arch> folder.
119-
120-
### Windows
121-
* Clone the git repository into your working copy folder
122-
* Open `<working copy folder>`/Builds/MsVc2022.win/OdbcFb.sln with MS Visual Studio (VS2022 or later)
123-
* Select your desired arch & build mode (debug|release)
124-
* Build the project
125-
* Copy the built library (`<working copy folder>`\Builds\MsVc2022.win\\`arch`\\`build_mode`\FirebirdODBC.dll) to `<Windows>`\System32 (x64 arch) or `<Windows>`\SysWOW64 (Win32 arch)
111+
### Prerequisites
112+
113+
Install [PowerShell](https://github.com/PowerShell/PowerShell) (v7+), then run:
114+
115+
```powershell
116+
./install-prerequisites.ps1
117+
```
118+
119+
This installs the required PowerShell modules ([InvokeBuild](https://github.com/nightroman/Invoke-Build) and [PSFirebird](https://github.com/fdcastel/PSFirebird)).
120+
121+
On Linux, you also need the unixODBC development package:
122+
123+
```bash
124+
sudo apt-get install unixodbc unixodbc-dev
125+
```
126+
127+
### Building
128+
129+
```powershell
130+
Invoke-Build build -Configuration Release
131+
```
132+
133+
This runs CMake to configure and build the driver. The output is:
134+
- **Windows**: `build/Release/FirebirdODBC.dll`
135+
- **Linux**: `build/libOdbcFb.so`
136+
137+
### Testing
138+
139+
```powershell
140+
Invoke-Build test -Configuration Release
141+
```
142+
143+
This will build the driver, download Firebird 5.0, create test databases, register the ODBC driver, and run the full test suite with multiple charset configurations.
144+
145+
### Available tasks
146+
147+
| Task | Description |
148+
|------|-------------|
149+
| `build` | Build the driver and tests (default) |
150+
| `test` | Build, install driver, create test databases, run tests |
151+
| `install` | Register the ODBC driver on the system |
152+
| `uninstall` | Unregister the ODBC driver |
153+
| `clean` | Remove the build directory |
154+
155+
### Alternative: Visual Studio
156+
157+
You can also open `Builds/MsVc2022.win/OdbcFb.sln` with Visual Studio 2022 or later. Run `cmake -B build` first to fetch the required Firebird headers.
126158

127159
## Development & Feedback
128160

0 commit comments

Comments
 (0)