-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 3.01 KB
/
ci.yaml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: tests
on:
push:
branches:
- main
pull_request:
jobs:
check-format:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check formatting
run: python ${{ github.workspace }}/scripts/check_format.py --clang-format=clang-format-18
check-tidy:
runs-on: ubuntu-24.04
env:
build_dir: ${{ github.workspace }}/build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install libfmt-dev libpq-dev libsqlite3-dev catch2 unixodbc-dev
- name: Configure CMake
run: cmake -B ${{ env.build_dir }} -S ${{ github.workspace }}
- name: Run clang-tidy
run: python ${{ github.workspace }}/scripts/tidy.py --clang-tidy=run-clang-tidy-18 --compile-commands=${{ env.build_dir }}
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
compiler:
- g++
- clang++
env:
build_dir: ${{ github.workspace }}/build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install libfmt-dev libpq-dev libsqlite3-dev catch2 unixodbc-dev libsqliteodbc
- name: Configure CMake
run: CXX=${{ env.compiler }} cmake -B ${{ env.build_dir }} -S ${{ github.workspace }} -DPFR_ORM_ASAN:BOOL=ON
- name: Build tests
run: cmake --build ${{ env.build_dir }}
- name: Run tests
env:
PODRM_ODBC_CONNECTION_STRING: DRIVER=SQLite3;Database=:memory:;FKSupport=true
run: ctest --output-on-failure --test-dir ${{ env.build_dir }}
test-gsl:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-14
- ubuntu-24.04
env:
build_dir: ${{ github.workspace }}/build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies (macOS)
run: |
brew install fmt postgresql@14 cpp-gsl catch2 unixodbc sqliteodbc
sudo cp data/macos-odbcinst.ini /opt/homebrew/etc/odbcinst.ini
sudo ln -s /opt/homebrew/etc/odbcinst.ini /etc/odbcinst.ini
sudo ln -s /opt/homebrew/etc/odbc.ini /etc/odbc.ini
if: matrix.os == 'macos-14'
- name: Install dependencies (Ubuntu)
run: sudo apt-get install libfmt-dev libpq-dev libsqlite3-dev libmsgsl-dev catch2 unixodbc-dev libsqliteodbc
if: matrix.os == 'ubuntu-24.04'
- name: Configure CMake
run: cmake -B ${{ env.build_dir }} -S ${{ github.workspace }} -DPFR_ORM_ASAN:BOOL=ON -DPODRM_USE_GSL_SPAN:BOOL=ON -DCMAKE_FIND_FRAMEWORK=NEVER
- name: Build tests
run: cmake --build ${{ env.build_dir }}
- name: Run tests
env:
PODRM_ODBC_CONNECTION_STRING: DRIVER=SQLite3;Database=:memory:;FKSupport=true
run: ctest --output-on-failure --test-dir ${{ env.build_dir }}