Skip to content

Commit

Permalink
refs #8659 - fixed CMake installation / added tests for make and CMak…
Browse files Browse the repository at this point in the history
…e install targets to CI (#7100)
  • Loading branch information
firewave authored Dec 12, 2024
1 parent 6472da9 commit f16fb98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 54 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,18 @@ jobs:
# pcre was removed from runner images in November 2022
brew install coreutils qt@6 pcre
- name: CMake build on ubuntu (with GUI)
- name: Run CMake on ubuntu (with GUI)
if: contains(matrix.os, 'ubuntu')
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build cmake.output -- -j$(nproc)
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=${{ matrix.use_qt6 }} -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install
- name: CMake build on macos (with GUI)
- name: Run CMake on macos (with GUI)
if: contains(matrix.os, 'macos')
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install -DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
- name: Run CMake build
run: |
cmake --build cmake.output -- -j$(nproc)
- name: Run CMake test
Expand All @@ -165,6 +167,10 @@ jobs:
pushd cmake.output
ctest --output-on-failure -j$(nproc)
- name: Run CMake install
run: |
cmake --build cmake.output --target install
build_uchar:

strategy:
Expand Down Expand Up @@ -382,6 +388,11 @@ jobs:
run: |
make -j$(nproc) checkCWEEntries validateXML
- name: Test install
run: |
# this is only to test the "install" target - since we did not build with FILESDIR it would not work as intended
make DESTDIR=cppcheck-make-install FILESDIR=/share/Cppcheck install
- name: Test Signalhandler
run: |
cmake -S . -B cmake.output.signal -G "Unix Makefiles" -DBUILD_TESTS=On
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/CI-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ jobs:
modules: 'qtcharts'
cache: true

- name: Build GUI release (Qt 5)
- name: Run CMake for GUI release (Qt 5)
if: startsWith(matrix.qt_ver, '5')
run: |
; TODO: enable rules?
; specify Release build so matchcompiler is used
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel!
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install || exit /b !errorlevel!
- name: Build GUI release (Qt 6)
- name: Run CMake for GUI release (Qt 6)
if: startsWith(matrix.qt_ver, '6')
run: |
; TODO: enable rules?
; specify Release build so matchcompiler is used
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On || exit /b !errorlevel!
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DBUILD_ONLINE_HELP=On -DCMAKE_INSTALL_PREFIX=cppcheck-cmake-install || exit /b !errorlevel!
- name: Run CMake build
run: |
cmake --build build --target cppcheck-gui --config Release || exit /b !errorlevel!
- name: Deploy GUI
Expand All @@ -73,6 +75,10 @@ jobs:
# TODO: run GUI tests

- name: Run CMake install
run: |
cmake --build build --target install
build:
strategy:
matrix:
Expand Down
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (BUILD_CLI)
COMPONENT applications)

install(PROGRAMS ${CMAKE_SOURCE_DIR}/htmlreport/cppcheck-htmlreport
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
COMPONENT applications)

install(FILES ${addons_py}
Expand Down

0 comments on commit f16fb98

Please sign in to comment.