Skip to content

Commit be13726

Browse files
committed
Tests and MacOS build in Github Actions
1 parent f104a2c commit be13726

1 file changed

Lines changed: 96 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 96 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ permissions:
1313

1414
concurrency:
1515
group: main
16-
cancel-in-progress: true
1716

1817
jobs:
1918
build-linux:
@@ -40,7 +39,27 @@ jobs:
4039
- name: Install system dependencies
4140
run: |
4241
sudo apt-get update
43-
sudo apt-get install --no-install-recommends -y doxygen graphviz ninja-build
42+
sudo apt-get install --no-install-recommends -y \
43+
doxygen \
44+
graphviz \
45+
ninja-build \
46+
libtommath1 \
47+
libtomcrypt1
48+
49+
- name: Install Firebird
50+
run: |
51+
wget -nv -O Firebird-5.0.3.1683-0-linux-x64.tar.gz \
52+
"https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-linux-x64.tar.gz"
53+
tar xzf Firebird-5.0.3.1683-0-linux-x64.tar.gz
54+
(cd Firebird-5.0.3.1683-0-linux-x64 && sudo ./install.sh -silent)
55+
56+
- name: Configure Firebird
57+
run: |
58+
{
59+
echo "FIREBIRD=/opt/firebird"
60+
echo "FIREBIRD_LOCK=${RUNNER_TEMP}"
61+
echo "LD_LIBRARY_PATH=/opt/firebird/lib:${LD_LIBRARY_PATH}"
62+
} >> "$GITHUB_ENV"
4463
4564
- name: Bootstrap vcpkg
4665
run: |
@@ -54,6 +73,10 @@ jobs:
5473
run: |
5574
cmake --build build/Release
5675
76+
- name: Run tests
77+
run: |
78+
./build/Release/out/bin/fb-cpp-test --log_level=all
79+
5780
- name: Build documentation
5881
run: |
5982
cmake --build build/Release --target docs
@@ -84,6 +107,19 @@ jobs:
84107
restore-keys: |
85108
${{ runner.os }}-vcpkg-
86109
110+
- name: Install Firebird
111+
shell: cmd
112+
run: |
113+
set FB_ZIP=Firebird-5.0.3.1683-0-windows-x64.zip
114+
powershell Invoke-WebRequest ^
115+
"https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/$env:FB_ZIP" -OutFile "$env:FB_ZIP"
116+
7z x -oC:\Firebird %FB_ZIP%
117+
118+
- name: Configure Firebird
119+
shell: cmd
120+
run: |
121+
echo C:\Firebird>>%GITHUB_PATH%
122+
87123
- name: Bootstrap vcpkg
88124
shell: cmd
89125
run: |
@@ -99,11 +135,69 @@ jobs:
99135
run: |
100136
cmake --build build --config Release
101137
138+
- name: Run tests
139+
shell: cmd
140+
run: |
141+
build\out\bin\Release\fb-cpp-test.exe
142+
143+
build-macos:
144+
runs-on: macos-latest
145+
steps:
146+
- name: Checkout repository
147+
uses: actions/checkout@v4
148+
with:
149+
submodules: recursive
150+
fetch-depth: 0
151+
152+
- name: Cache vcpkg artifacts
153+
uses: actions/cache@v4
154+
with:
155+
path: |
156+
vcpkg/downloads
157+
vcpkg/buildtrees
158+
vcpkg/packages
159+
build/Release/vcpkg_installed
160+
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
161+
restore-keys: |
162+
${{ runner.os }}-vcpkg-
163+
164+
- name: Install Firebird
165+
run: |
166+
wget -nv -O Firebird-5.0.3.1683-0-macos-arm64.pkg \
167+
"https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-macos-arm64.pkg"
168+
sudo installer -verbose -pkg Firebird-5.0.3.1683-0-macos-arm64.pkg -target /
169+
170+
- name: Configure Firebird
171+
run: |
172+
{
173+
echo "FIREBIRD_LOCK=${RUNNER_TEMP}"
174+
echo "DYLD_LIBRARY_PATH=/Library/Frameworks/Firebird.framework/Resources/lib:${DYLD_LIBRARY_PATH}"
175+
echo "ISC_USER=sysdba"
176+
echo "ISC_PASSWORD=masterkey"
177+
} >> "$GITHUB_ENV"
178+
179+
- name: Bootstrap vcpkg
180+
run: |
181+
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
182+
183+
- name: Configure CMake
184+
run: |
185+
cmake -S . -B build/Release -DCMAKE_BUILD_TYPE=Release -G Ninja
186+
187+
- name: Build Release targets
188+
run: |
189+
cmake --build build/Release
190+
191+
- name: Run tests
192+
run: |
193+
./build/Release/out/bin/fb-cpp-test --log_level=all
194+
102195
deploy-docs:
103196
runs-on: ubuntu-latest
104197
needs:
105198
- build-linux
106199
- build-windows
200+
- build-macos
107201
environment:
108202
name: github-pages
109203
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)