chore: fix clang-format and all cmake bool options set to true/false
[KDIS.git] / .github / workflows / check.yaml
bloba0221624ae57a3deab207f43436175be7942f40b
1 name: check
3 on:
4     push:
5         branches:
6             - master
7         tags:
8             - v*
9     pull_request:
10         branches:
11             - master
13 concurrency:
14     group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15     cancel-in-progress: true
17 jobs:
18     version:
19         name: Version
20         if: startsWith(github.ref_name, 'v')
21         runs-on: ubuntu-latest
22         steps:
23             - name: Checkout
24               uses: actions/checkout@v4
25               with:
26                   fetch-depth: 0
28             - name: Check Git tag format
29               run: |
30                   _tag="${{ github.ref_name }}"
31                   if ! printf "%s\n" "$_tag" | grep -q -P '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(alpha|beta|rc)\.(0|[1-9][0-9]*))?$'; then
32                     printf '[ERROR]: Git tag (%s) wrong format\n' "$_tag"
33                     exit 1
34                   fi
36     code:
37         name: Code
38         needs: version
39         if: always() && (needs.version.result == 'success' || needs.version.result == 'skipped')
40         runs-on: ubuntu-latest
41         steps:
42             - name: Checkout
43               uses: actions/checkout@v4
44               with:
45                   fetch-depth: 0
47             - name: Setup Python
48               uses: actions/setup-python@v4
50             - name: Install cmakelang
51               run: pip install cmakelang[YAML]
53             - name: Check
54               run: |
55                   chmod u+x ./scripts/check.sh
57                   ./scripts/check.sh \
58                       --log-level debug
60     build:
61         name: Build
62         needs: code
63         if: always() && needs.code.result == 'success'
64         strategy:
65             fail-fast: true
66             matrix:
67                 # TODO(carlocorradini) Add macos-latest
68                 os: [ubuntu-latest, windows-latest]
69                 build: [Debug, Release]
70                 dis: [5, 6, 7]
71         runs-on: ${{ matrix.os }}
72         steps:
73             - name: Checkout
74               uses: actions/checkout@v4
75               with:
76                   fetch-depth: 0
78             - name: Install Doxygen
79               uses: ssciwr/doxygen-install@v1
81             - name: Configure CMake
82               run: cmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build }} -DDIS_VERSION:STRING=${{ matrix.dis }} -DBUILD_SHARED_LIBS:BOOL=FALSE -DKDIS_BUILD_DOCS:BOOL=TRUE -DKDIS_BUILD_EXAMPLES:BOOL=TRUE -DKDIS_BUILD_TESTS:BOOL=TRUE
84             - name: Build
85               run: cmake --build ./build --config ${{ matrix.build }}
87             - name: Test
88               run: ctest --verbose --test-dir ./build/tests --build-config ${{ matrix.build }}
90             # TODO(carlocorradini) Code coverage