Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5ec2c10
Add CI workflow for build and test automation
Forsrobin Jul 25, 2025
9abb4ed
Refactor CI workflow to comment out unused build configurations and i…
Forsrobin Jul 25, 2025
81df32f
Update task labels and add new build configurations for server and te…
Forsrobin Jul 25, 2025
074f4cc
Fix toolchain file paths in CI workflow and update system dependencie…
Forsrobin Jul 25, 2025
bb7aedd
Fix installation command for system dependencies in CI workflow
Forsrobin Jul 25, 2025
adc6d21
Add build configurations for Release and Debug in CI workflow
Forsrobin Jul 25, 2025
d87242c
Rename conan-dev to conan-deb-dev and update inherits for Unix and Vi…
Forsrobin Jul 25, 2025
9859a96
Refactor CI workflow and CMake configuration: comment out unused buil…
Forsrobin Jul 25, 2025
39153bd
Fix toolchain file paths in CI workflow to remove unnecessary directo…
Forsrobin Jul 25, 2025
7fee4ad
Remove conan toolchain file configuration from CMake setup in CI work…
Forsrobin Jul 25, 2025
a440744
Update CMake presets: rename conan-deb configurations and add CMakeUs…
Forsrobin Jul 25, 2025
1e6764c
Enhance CI workflow: add missing dependencies and set C++ standard fl…
Forsrobin Jul 25, 2025
7b755bb
Format CI workflow YAML: standardize spacing and improve readability
Forsrobin Jul 25, 2025
cd7e023
Fix CMake command: remove redundant CXX flags in build step
Forsrobin Jul 25, 2025
251d6c0
Refactor CI workflow: uncomment Debug Shared configuration and clean …
Forsrobin Jul 25, 2025
ec713f9
Enhance CMake configuration: set C++ standard to C++23 and specify li…
Forsrobin Jul 25, 2025
94d9ec2
Refactor CI workflow: update CMake configuration and enhance test reg…
Forsrobin Jul 25, 2025
3f558b6
Update CMake configuration: switch to GCC for compiler and enable tes…
Forsrobin Jul 25, 2025
a7929f1
Update CMake configuration: switch C++ compiler to Clang 17
Forsrobin Jul 25, 2025
c2d7152
Update CMake configuration: switch C++ compiler to Clang 19 and forma…
Forsrobin Jul 25, 2025
cd6c8f7
Refactor CMake presets: replace Unix Makefiles with Clang for Unix co…
Forsrobin Jul 25, 2025
a94f4a0
Update CI workflow: install additional Clang and LLVM packages for te…
Forsrobin Jul 25, 2025
95dc3a1
Update CI workflow: remove unnecessary lldb and lld packages from sys…
Forsrobin Jul 25, 2025
0f01051
Update CI workflow: remove clang-17 from system dependencies
Forsrobin Jul 25, 2025
6b21caa
Fix typo in Conan profile command in CI workflow
Forsrobin Jul 25, 2025
34be87d
Update CI workflow: install Clang 19 and configure build environment
Forsrobin Jul 26, 2025
5c24b81
Remove unnecessary CMake configuration step in CI workflow
Forsrobin Jul 26, 2025
02ac0e6
Update CI workflow: add ninja-build to Clang 19 installation step
Forsrobin Jul 26, 2025
81e8cc0
Refactor CMake configuration: remove CMAKE_CXX_FLAGS from conan-deb-u…
Forsrobin Jul 26, 2025
56e303f
Update CMake configuration: add CMAKE_CXX_FLAGS for conan-deb-unix pr…
Forsrobin Jul 26, 2025
b4a3869
Refactor Session initialization method and update BANKID_API definiti…
Forsrobin Jul 26, 2025
0686746
Enhance CMake configuration: set symbol visibility for shared librari…
Forsrobin Jul 26, 2025
2c9bdd9
Update CI workflow: streamline Clang 19 installation and remove unuse…
Forsrobin Jul 26, 2025
91e49de
Refactor CI workflow: remove unnecessary CMake preset setup and simpl…
Forsrobin Jul 26, 2025
29f14a8
Update CI workflow: reintroduce Release configuration and remove comm…
Forsrobin Jul 26, 2025
2d1344d
Refactor error handling: wrap status codes in a struct for improved c…
Forsrobin Jul 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/build-test-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI Build and Test

on:
pull_request:
branches: [main, develop]

jobs:
build-and-test:
strategy:
matrix:
config:
- name: "Release"
build_type: "Release"
conan_profile: "Release"
cmake_preset: "unix-rel-ninja" # Will be modified for shared
- name: "Debug"
build_type: "Debug"
conan_profile: "Debug"
cmake_preset: "unix-deb-ninja" # Will be modified for shared

runs-on: ubuntu-latest
name: ${{ matrix.config.name }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Clang 19
run: |
sudo apt-get update
sudo apt-get install -y clang-19 ninja-build

- name: Configure with Clang 19
run: |
export CC=clang-19
export CXX=clang++-19

- name: Install Conan
run: |
python -m pip install --upgrade pip
pip install conan

- name: Configure Conan
run: |
conan profile detect --force
conan profile show

- name: Install dependencies with Conan
run: |
conan install . -s build_type=${{ matrix.config.conan_profile }} -of=conan/${{ matrix.config.build_type == 'Debug' && 'debug' || 'release' }} --build=missing

- name: Configure CMake
run: |
export PATH="/usr/bin:$PATH"
cmake --preset ${{ matrix.config.cmake_preset }} -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja

- name: Build project
run: |
cmake --build --preset ${{ matrix.config.build_type == 'Debug' && 'unix-deb-ninja' || 'unix-rel-ninja' }} --config ${{ matrix.config.build_type }}

- name: Run tests
if: ${{ matrix.config.build_type == 'Debug' }}
run: |
cd build/${{ matrix.config.cmake_preset }}/tests
ctest -C ${{ matrix.config.build_type }} --output-on-failure

- name: Upload build artifacts (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.config.name }}
path: |
build/
!build/**/CMakeFiles/
retention-days: 7
28 changes: 24 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "Run Server (Static)",
"label": "Run Server Debug (Static)",
"type": "shell",
"command": "./bankid_server.exe",
"options": {
Expand All @@ -12,7 +12,7 @@
"isBackground": true
},
{
"label": "Run Server (Shared)",
"label": "Run Server Debug (Shared)",
"type": "shell",
"command": "./bankid_server.exe",
"group": "test",
Expand All @@ -22,7 +22,27 @@
"isBackground": true
},
{
"label": "Run Tests (Static)",
"label": "Run Server Release (Static)",
"type": "shell",
"command": "./bankid_server.exe",
"options": {
"cwd": "${workspaceFolder}/build/vs2022-rel/server/Release"
},
"group": "test",
"isBackground": true
},
{
"label": "Run Server Release (Shared)",
"type": "shell",
"command": "./bankid_server.exe",
"group": "test",
"options": {
"cwd": "${workspaceFolder}/build/vs2022-rel-shared/server/Release"
},
"isBackground": true
},
{
"label": "Run Tests Debug (Static)",
"type": "shell",
"command": "./bankid_tests.exe",
"options": {
Expand All @@ -33,7 +53,7 @@
"problemMatcher": []
},
{
"label": "Run Tests (Shared)",
"label": "Run Tests Debug (Shared)",
"type": "shell",
"command": "./bankid_tests.exe",
"options": {
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif()

option(BUILD_SHARED_LIBS "Build shared library" Off)

option(BUILD_TESTS "Build tests" On)
# option(BUILD_TESTS "Build tests" On)

add_subdirectory(bankid)
add_subdirectory(server)
Expand Down
144 changes: 54 additions & 90 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan/debug/build/generators/conan_toolchain.cmake"
}
},
{
"name": "conan-deb-unix",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan/debug/build/Debug/generators/conan_toolchain.cmake"
}
},
{
"name": "conan-rel",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan/release/build/generators/conan_toolchain.cmake"
}
},
{
"name": "conan-rel-unix",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan/release/build/Release/generators/conan_toolchain.cmake"
}
},
{
"name": "rel",
"hidden": true,
Expand All @@ -28,35 +49,16 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": true
}
},
{
"name": "unix-make",
"hidden": true,
"generator": "Unix Makefiles",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_FLAGS_INIT": "$env{CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -pedantic"
}
},
{
"name": "unix-ninja",
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-17",
"CMAKE_CXX_COMPILER": "clang++-17",
"CMAKE_CXX_COMPILER": "clang++-19",
"CMAKE_C_COMPILER": "clang-19",
"CMAKE_CXX_FLAGS_INIT": "$env{CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -pedantic"
}
},
{
"name": "unix-shared",
"hidden": true,
"inherits": "unix-make",
"cacheVariables": {
"CMAKE_CXX_FLAGS_INIT": "$env{CMAKE_CXX_FLAGS_INIT} $env{CMAKE_CXX_FLAGS} -fPIC -Werror -Wall -Wextra -pedantic",
"BUILD_SHARED_LIBS": true
}
},
{
"name": "vs2022",
"hidden": true,
Expand All @@ -74,68 +76,42 @@
"BUILD_SHARED_LIBS": true
}
},

{
"name": "unix-rel",
"displayName": "Unix Make Release",
"binaryDir": "${sourceDir}/build/unix-rel",
"inherits": ["unix-make", "rel"],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-rel/install"
}
},
{
"name": "unix-rel-ninja",
"displayName": "Unix Ninja Clang Release",
"binaryDir": "${sourceDir}/build/unix-rel-ninja",
"inherits": ["unix-ninja", "rel"],
"inherits": [
"unix-ninja",
"rel",
"conan-rel-unix"
],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-rel-ninja/install"
}
},
{
"name": "unix-rel-shared",
"displayName": "Unix Make Release Shared",
"binaryDir": "${sourceDir}/build/unix-rel-shared",
"inherits": ["unix-shared", "unix-rel"],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-rel-shared/install"
}
},
{
"name": "unix-deb",
"displayName": "Unix Make Debug",
"binaryDir": "${sourceDir}/build/unix-deb",
"inherits": ["unix-make", "deb", "conan-deb"],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-O0 --coverage -g -fsanitize=address",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-deb/install"
}
},
{
"name": "unix-deb-ninja",
"displayName": "Unix Ninja Clang Debug",
"binaryDir": "${sourceDir}/build/unix-deb-ninja",
"inherits": ["unix-ninja", "deb", "conan-deb"],
"inherits": [
"unix-ninja",
"deb",
"conan-deb-unix"
],
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-O0 --coverage -g -fsanitize=address",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-deb-ninja/install"
}
},
{
"name": "unix-deb-shared",
"displayName": "Unix Make Debug Shared",
"binaryDir": "${sourceDir}/build/unix-deb-shared",
"inherits": ["unix-shared", "unix-deb"],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-deb-shared/install"
}
},
{
"name": "vs2022-rel",
"displayName": "Visual Studio 2022 Release",
"binaryDir": "${sourceDir}/build/vs2022-rel",
"inherits": ["vs2022", "rel"],
"inherits": [
"vs2022",
"rel",
"conan-rel"
],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/vs2022-rel/install"
}
Expand All @@ -144,7 +120,11 @@
"name": "vs2022-deb",
"displayName": "Visual Studio 2022 Debug",
"binaryDir": "${sourceDir}/build/vs2022-deb",
"inherits": ["vs2022", "deb", "conan-deb"],
"inherits": [
"vs2022",
"deb",
"conan-deb"
],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/vs2022-deb/install"
}
Expand All @@ -153,7 +133,11 @@
"name": "vs2022-rel-shared",
"displayName": "Visual Studio 2022 Release Shared",
"binaryDir": "${sourceDir}/build/vs2022-rel-shared",
"inherits": ["vs2022-shared", "rel"],
"inherits": [
"vs2022-shared",
"rel",
"conan-rel"
],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/vs2022-rel/install"
}
Expand All @@ -162,7 +146,11 @@
"name": "vs2022-deb-shared",
"displayName": "Visual Studio 2022 Debug Shared",
"binaryDir": "${sourceDir}/build/vs2022-deb-shared",
"inherits": ["vs2022-shared", "deb", "conan-deb"],
"inherits": [
"vs2022-shared",
"deb",
"conan-deb"
],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/vs2022-rel/install"
}
Expand Down Expand Up @@ -193,41 +181,17 @@
"configurePreset": "vs2022-deb-shared",
"configuration": "Debug"
},
{
"name": "unix-deb",
"displayName": "Unix Make Debug Build",
"configurePreset": "unix-deb",
"configuration": "Debug"
},
{
"name": "unix-deb-ninja",
"displayName": "Unix Ninja Debug Build",
"configurePreset": "unix-deb-ninja",
"configuration": "Debug"
},
{
"name": "unix-deb-shared",
"displayName": "Unix Make Debug Build",
"configurePreset": "unix-deb-shared",
"configuration": "Debug"
},
{
"name": "unix-rel",
"displayName": "Unix Make Release Build",
"configurePreset": "unix-rel",
"configuration": "Release"
},
{
"name": "unix-rel-ninja",
"displayName": "Unix Ninja Release Build",
"configurePreset": "unix-rel-ninja",
"configuration": "Release"
},
{
"name": "unix-rel-shared",
"displayName": "Unix Make Release Build",
"configurePreset": "unix-rel-shared",
"configuration": "Release"
}
]
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,9 @@ We welcome contributions to improve the BankID C++ library! Here's how you can h

# Install dependencies
conan install . -s build_type=Debug -of=conan/debug --build=missing

# For release build
conan install . -s build_type=Release -of=conan/release --build=missing
```

3. **Build and Test**
Expand Down
Loading