Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 0 additions & 37 deletions .github/workflows/build-test.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: 'unit-testing'

on:
push:
pull_request:
types:
- reopened
- ready_for_review
branches:
- main
- develop
workflow_dispatch:

jobs:
build-test-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt update
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt install -y cmake graphviz g++-13 gcc-13

- uses: actions/checkout@v4

- name: Configure
env:
CC: gcc-13
CXX: g++-13
run: cmake -S . -B build

- name: Build
run: cd build && cmake --build .

- name: Unit testing
run: cd build && ctest

build-test-macos:
runs-on: macos-latest
steps:
- name: Install dependencies
run: |
brew install cmake graphviz
softwareupdate --install -a
/usr/bin/xcodebuild -version

- uses: actions/checkout@v4

- name: Configure
run: cmake -S . -B build -DEXPERIMENTAL=1

- name: Build
run: cd build && cmake --build .

- name: Unit testing
run: cd build && ctest

build-test-windows:
runs-on: windows-latest
steps:
- name: Install dependencies
run: |
choco install -y graphviz cmake

- uses: actions/checkout@v4

- name: Configure
run: cmake -S . -B build

- name: Build
run: cd build && cmake --build .

- name: Unit testing
run: cd build && ctest
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ if (PACKAGE)
set(MACROS_PACKAGE_FLAGS "-DCREATE_PACKAGE ${PACKAGE_TYPE_FLAG}")
endif ()

set(MACROS_FLAGS "-DSCC_VERSION=\"\\\"${PRJ_VERSION}\\\"\" \
-DSCC_MAINTAINERS=\"\\\"${PRJ_MAINTAINERS}\\\"\" ${MACROS_PACKAGE_FLAGS}")
set(COMPILATION_FLAGS "-Wall -Wextra -g ${MACROS_FLAGS}")
if (COVERAGE)
set(COMPILATION_FLAGS "${COMPILATION_FLAGS} --coverage")
if (NOT WIN32)
set(MACROS_FLAGS "-DSCC_VERSION=\"\\\"${PRJ_VERSION}\\\"\" \
-DSCC_MAINTAINERS=\"\\\"${PRJ_MAINTAINERS}\\\"\" ${MACROS_PACKAGE_FLAGS}")
set(COMPILATION_FLAGS "-Wall -Wextra -g ${MACROS_FLAGS}")
if (COVERAGE)
set(COMPILATION_FLAGS "${COMPILATION_FLAGS} --coverage")
endif()
set(CMAKE_C_FLAGS ${COMPILATION_FLAGS})
if (EXPERIMENTAL)
message("Adding -fexperimental-library flag to C++ compilation")
set(COMPILATION_FLAGS "${COMPILATION_FLAGS} -fexperimental-library")
endif()
set(CMAKE_CXX_FLAGS ${COMPILATION_FLAGS})
endif()
set(CMAKE_C_FLAGS ${COMPILATION_FLAGS})
set(CMAKE_CXX_FLAGS ${COMPILATION_FLAGS})

## Download dependencies

Expand Down