adjust CI builds * split up build and test process * build and run tests twice - once from regular build folder - once from demo Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
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
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index bfda74b..06eb58a 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -156,9 +156,9 @@ jobs:
cc: [ clang, gcc ]
config:
# Static library build
- - { CMAKEOPTIONS: '', TARGET: 'check' }
+ - { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=Off' }
# Shared library build
- - { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=On', TARGET: 'check'}
+ - { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=On' }
steps:
- uses: actions/checkout@v2
- name: install dependencies
@@ -169,5 +169,18 @@ jobs:
run: |
mkdir build
cd build
- CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
- make -j$(nproc) ${{ matrix.config.TARGET }}
+ CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
+ make -j$(nproc)
+ - name: test
+ run: |
+ cd build
+ CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} -DBUILD_TESTING=On ..
+ make -j$(nproc)
+ ctest
+ - name: test (in demo folder)
+ run: |
+ mkdir -p demo/build
+ cd demo/build
+ CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
+ make -j$(nproc)
+ ctest