-
-
Notifications
You must be signed in to change notification settings - Fork 15
80 lines (67 loc) · 2.19 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-24.04
- windows-latest
# - macos-latest
config:
- qt_version: "6.4.2"
steps:
- name: Install dependencies on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt update -qq
sudo apt install -y doxygen graphviz postgresql-server-dev-16
- name: Install dependencies on macOS
if: runner.os == 'macOS'
run: |
brew install postgresql@16
- name: Install PostgreSQL 16 with Chocolatey
if: runner.os == 'Windows'
run: |
choco install postgresql --version=16.0 -y
refreshenv # Reload environment to add PostgreSQL to PATH
- name: Install Qt with options and default aqtversion
uses: jurplel/install-qt-action@v4
with:
aqtversion: null # use whatever the default is
version: ${{ matrix.config.qt_version }}
cache: true
- name: Install ninja-build tool (must be after Qt due PATH changes)
uses: turtlesec-no/get-ninja@main
- name: Make sure MSVC is found when Ninja generator is in use
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure project
run: >
cmake -S . -B ./build -G Ninja
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/postgresql@16
-DENABLE_MAINTAINER_CFLAGS=${{ matrix.build_type == 'Debug' }}
-DBUILD_SHARED_LIBS=${{ matrix.build_type == 'Debug' }}
- name: Build project
run: cmake --build ./build
- name: Run tests
id: ctest
run: ctest --test-dir ./build -C Debug --output-on-failure
- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ steps.ctest.conclusion == 'failure' }}
with:
path: "./build/Testing/Temporary/LastTest.log"