Skip to content

Add 'cowl_object_type_from_string' #537

Add 'cowl_object_type_from_string'

Add 'cowl_object_type_from_string' #537

Workflow file for this run

name: Build and test
on:
push:
branches: [dev]
env:
build_dir: build
build_config: Release
cflags_gnuc: -Werror -fsanitize=address
lflags_gnuc: -fsanitize=address
cflags_msvc: /WX
lflags_msvc: ''
doxygen_version: ${{secrets.doxygen_version}}
jobs:
build:
name: Build and test
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
lib_type: [STATIC, SHARED]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure runner
run: |
if [ $RUNNER_OS == 'Windows' ]; then
echo 'cflags="${{env.cflags_msvc}}"' >> $GITHUB_ENV
echo 'lflags="${{env.lflags_msvc}}"' >> $GITHUB_ENV
choco install winflexbison3
else
echo 'cflags="${{env.cflags_gnuc}}"' >> $GITHUB_ENV
echo 'lflags="${{env.lflags_gnuc}}"' >> $GITHUB_ENV
if [ $RUNNER_OS == 'macOS' ]; then
brew install flex bison
echo '/usr/local/opt/bison/bin' >> $GITHUB_PATH
echo '/usr/local/opt/flex/bin' >> $GITHUB_PATH
fi
fi
shell: bash
- name: Configure CMake
run: >
cmake -B ${{env.build_dir}}
-DULIB_LEAKS=ON
-DULIB_LIBRARY_TYPE=${{matrix.lib_type}}
-DCOWL_LIBRARY_TYPE=${{matrix.lib_type}}
-DCOWL_ENTITY_IDS=ON
-DCMAKE_SYSTEM_VERSION=''
-DCMAKE_BUILD_TYPE=${{env.build_config}}
-DCMAKE_C_FLAGS=${{env.cflags}}
-DCMAKE_CXX_FLAGS=${{env.cflags}}
-DCMAKE_SHARED_LINKER_FLAGS=${{env.lflags}}
-DCMAKE_EXE_LINKER_FLAGS=${{env.lflags}}
- name: Build
run: >
cmake --build ${{env.build_dir}}
--config ${{env.build_config}}
--target cowl-test cowl-cpp-test cowl-bench cowl-examples cowl-tools
- name: Configure tests
working-directory: ${{env.build_dir}}
if: matrix.os == 'windows-latest'
run: |
mv test/${{env.build_config}}/*.exe test
mv examples/${{env.build_config}}/*.exe examples
mv tools/${{env.build_config}}/*.exe tools
if [ ${{matrix.lib_type}} == 'SHARED' ]; then
find . -name '*.dll' -exec cp -t test {} + -exec cp -t examples {} + -exec cp -t tools {} +
fi
shell: bash
- name: Run tests
working-directory: ${{env.build_dir}}/test
run: ./cowl-test
- name: Run tests (C++)
working-directory: ${{env.build_dir}}/test
run: ./cowl-cpp-test
- name: Run benchmark
working-directory: ${{env.build_dir}}/test
run: ./cowl-bench
- name: Run examples
working-directory: ${{env.build_dir}}/examples
run: |
if [ $RUNNER_OS == 'Windows' ]; then
EXAMPLES=(./*-example.exe)
else
EXAMPLES=(./*-example)
fi
for EXAMPLE in "${EXAMPLES[@]}"; do
"${EXAMPLE}"
done
shell: bash
- name: Run tools
working-directory: ${{env.build_dir}}/tools
run: ./cowl-stats test_onto.owl
docs:
name: Generate the documentation
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure runner
run: |
brew update
if [ -z ${{env.doxygen_version}} ]; then
brew install doxygen
else
brew tap-new cowl/doxygen
brew extract --version=${{env.doxygen_version}} doxygen cowl/doxygen
brew install doxygen@${{env.doxygen_version}}
fi
pip3 install -U Sphinx sphinx-rtd-theme breathe
- name: Build docs
run: |
cmake -B ${{env.build_dir}} -DCOWL_READERS=''
cmake --build ${{env.build_dir}} --target cowl-docs