14 group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15 cancel-in-progress: true
20 if: startsWith(github.ref_name, 'v')
21 runs-on: ubuntu-latest
24 uses: actions/checkout@v4
28 - name: Check Git tag format
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"
37 name: Build & Test & Lint
41 # TODO(carlocorradini) Add macos-latest
42 os: [ubuntu-latest, windows-latest]
43 build: [Debug, Release]
45 runs-on: ${{ matrix.os }}
48 uses: actions/checkout@v4
53 uses: actions/setup-python@v4
55 - name: Install Doxygen
56 uses: ssciwr/doxygen-install@v1
58 - name: Install cmakelang
59 run: pip install cmakelang[YAML]
61 - name: Configure CMake
62 run: cmake -S . -B ./build -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DDIS_VERSION=${{ matrix.dis }} -DBUILD_SHARED_LIBS=OFF -DBUILD_DOCS=ON -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON
65 run: cmake --build ./build --config ${{ matrix.build }}
68 run: ctest --verbose --test-dir ./build/tests --build-config ${{ matrix.build }}
71 uses: DoozyX/clang-format-lint-action@v0.16.2
73 # TODO(carlocorradini) Clang Tidy
76 if: matrix.os != 'windows-latest'
77 run: find . -not -path './build/*' -not -path './cmake/CPM.cmake' -type f \( -name 'CMakeLists.txt' -o -name '*.cmake' \) -print0 | xargs -0 -n1 cmake-format --check
80 if: matrix.os == 'windows-latest'
81 run: Get-ChildItem -Exclude 'build' | Get-ChildItem -Recurse -File -Include 'CMakeLists.txt', '*.cmake' -Exclude 'CPM.cmake' | Foreach { cmake-format --check $_.fullname; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } }
84 if: matrix.os != 'windows-latest'
85 run: find . -not -path './build/*' -not -path './cmake/CPM.cmake' -type f \( -name 'CMakeLists.txt' -o -name '*.cmake' \) -print0 | xargs -0 -n1 cmake-lint
88 if: matrix.os == 'windows-latest'
89 run: Get-ChildItem -Exclude 'build' | Get-ChildItem -Recurse -File -Include 'CMakeLists.txt', '*.cmake' -Exclude 'CPM.cmake' | Foreach { cmake-lint $_.fullname; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } }
91 # TODO(carlocorradini) Cppcheck
92 # TODO(carlocorradini) Cpplint
93 # TODO(carlocorradini) Code coverage