2020-02-13 09:16:53 +01:00
|
|
|
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
|
|
|
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
2020-04-16 21:37:32 +02:00
|
|
|
name: CI-unixish
|
2020-02-13 09:16:53 +01:00
|
|
|
|
2023-09-01 18:52:20 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'releases/**'
|
|
|
|
tags:
|
|
|
|
- '2.*'
|
|
|
|
pull_request:
|
2020-02-13 09:16:53 +01:00
|
|
|
|
2022-08-26 23:25:07 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-02-13 09:16:53 +01:00
|
|
|
jobs:
|
2022-09-02 15:56:17 +02:00
|
|
|
build_cmake_tinyxml2:
|
2020-02-13 09:16:53 +01:00
|
|
|
|
2020-02-20 22:00:14 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-08-27 15:05:40 +02:00
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
2020-12-09 09:46:23 +01:00
|
|
|
fail-fast: false # Prefer quick result
|
2020-02-20 22:00:14 +01:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-02-13 09:16:53 +01:00
|
|
|
|
2022-09-26 18:21:43 +02:00
|
|
|
env:
|
2023-04-01 09:40:10 +02:00
|
|
|
# TODO: figure out why there are cache misses with PCH enabled
|
2022-09-26 18:21:43 +02:00
|
|
|
CCACHE_SLOPPINESS: pch_defines,time_macros
|
|
|
|
|
2020-02-13 09:16:53 +01:00
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2020-02-20 22:00:14 +01:00
|
|
|
|
2022-09-04 10:27:20 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-01-24 21:55:48 +01:00
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
if: contains(matrix.os, 'ubuntu')
|
2020-02-20 22:00:14 +01:00
|
|
|
run: |
|
2020-04-07 20:30:10 +02:00
|
|
|
sudo apt-get update
|
2022-09-02 15:56:17 +02:00
|
|
|
sudo apt-get install libxml2-utils libtinyxml2-dev qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
|
2022-05-10 13:03:58 +02:00
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
# coreutils contains "nproc"
|
2020-02-20 22:00:14 +01:00
|
|
|
- name: Install missing software on macos
|
2020-12-09 09:46:23 +01:00
|
|
|
if: contains(matrix.os, 'macos')
|
2020-02-20 22:00:14 +01:00
|
|
|
run: |
|
2022-11-25 15:11:57 +01:00
|
|
|
# pcre was removed from runner images in November 2022
|
|
|
|
brew install coreutils qt@5 tinyxml2 pcre
|
2021-12-16 17:45:34 +01:00
|
|
|
|
2022-02-06 13:02:52 +01:00
|
|
|
- name: CMake build on ubuntu (with GUI / system tinyxml2)
|
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2023-04-01 09:40:10 +02:00
|
|
|
cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
2022-09-04 10:27:20 +02:00
|
|
|
cmake --build cmake.output.tinyxml2 -- -j$(nproc)
|
2022-02-06 13:02:52 +01:00
|
|
|
|
2022-09-06 18:30:59 +02:00
|
|
|
- name: CMake build on macos (with GUI / system tinyxml2)
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
2023-04-01 09:40:10 +02:00
|
|
|
cmake -S . -B cmake.output.tinyxml2 -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DUSE_BUNDLED_TINYXML2=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5
|
2022-09-06 18:30:59 +02:00
|
|
|
cmake --build cmake.output.tinyxml2 -- -j$(nproc)
|
|
|
|
|
2022-02-06 13:02:52 +01:00
|
|
|
- name: Run CMake test (system tinyxml2)
|
|
|
|
run: |
|
|
|
|
cmake --build cmake.output.tinyxml2 --target check -- -j$(nproc)
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
build_cmake:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
2022-09-26 18:21:43 +02:00
|
|
|
env:
|
2023-04-01 09:40:10 +02:00
|
|
|
# TODO: figure out why there are cache misses with PCH enabled
|
2022-09-26 18:21:43 +02:00
|
|
|
CCACHE_SLOPPINESS: pch_defines,time_macros
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-04 10:27:20 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libxml2-utils qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
|
|
|
|
|
2023-08-16 19:35:53 +02:00
|
|
|
# TODO: move latest compiler to separate step
|
|
|
|
# TODO: bail out on warnings with latest GCC
|
2023-06-26 11:15:41 +02:00
|
|
|
- name: Set up GCC
|
|
|
|
uses: egor-tensin/setup-gcc@v1
|
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
|
|
with:
|
|
|
|
version: 13
|
|
|
|
platform: x64
|
|
|
|
|
|
|
|
- name: Select compiler
|
2023-08-16 19:35:53 +02:00
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
2023-06-26 11:15:41 +02:00
|
|
|
run: |
|
|
|
|
echo "CXX=g++-13" >> $GITHUB_ENV
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
# coreutils contains "nproc"
|
|
|
|
- name: Install missing software on macos
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
2022-11-25 15:11:57 +01:00
|
|
|
# pcre was removed from runner images in November 2022
|
|
|
|
brew install coreutils qt@5 pcre
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-01-24 21:55:48 +01:00
|
|
|
- name: CMake build on ubuntu (with GUI)
|
2021-12-17 13:06:50 +01:00
|
|
|
if: contains(matrix.os, 'ubuntu')
|
2020-09-05 18:29:19 +02:00
|
|
|
run: |
|
2023-04-01 09:40:10 +02:00
|
|
|
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
2022-09-04 10:27:20 +02:00
|
|
|
cmake --build cmake.output -- -j$(nproc)
|
2021-12-15 19:36:34 +01:00
|
|
|
|
2022-01-24 21:55:48 +01:00
|
|
|
- name: CMake build on macos (with GUI)
|
2021-12-16 17:45:34 +01:00
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
2023-04-01 09:40:10 +02:00
|
|
|
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5
|
2022-09-04 10:27:20 +02:00
|
|
|
cmake --build cmake.output -- -j$(nproc)
|
2021-12-16 17:45:34 +01:00
|
|
|
|
2021-12-15 19:36:34 +01:00
|
|
|
- name: Run CMake test
|
|
|
|
run: |
|
|
|
|
cmake --build cmake.output --target check -- -j$(nproc)
|
|
|
|
|
|
|
|
- name: Run CTest
|
|
|
|
run: |
|
2022-05-31 19:53:50 +02:00
|
|
|
pushd cmake.output
|
2023-05-03 17:32:28 +02:00
|
|
|
ctest --output-on-failure -j$(nproc)
|
2020-09-05 18:29:19 +02:00
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
build_uchar:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-03 21:21:24 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
# coreutils contains "nproc"
|
|
|
|
- name: Install missing software on macos
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
brew install coreutils
|
|
|
|
|
2022-05-31 19:53:50 +02:00
|
|
|
- name: Build with Unsigned char
|
2020-09-05 18:29:19 +02:00
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2020-09-05 18:29:19 +02:00
|
|
|
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
|
2022-05-31 19:53:50 +02:00
|
|
|
|
|
|
|
- name: Test with Unsigned char
|
|
|
|
run: |
|
2020-09-05 18:29:19 +02:00
|
|
|
./testrunner TestSymbolDatabase
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
build_mathlib:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-03 21:21:24 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
# coreutils contains "nproc"
|
|
|
|
- name: Install missing software on macos
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
brew install coreutils
|
|
|
|
|
2022-05-31 19:53:50 +02:00
|
|
|
- name: Build with TEST_MATHLIB_VALUE
|
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2022-05-31 19:53:50 +02:00
|
|
|
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all
|
|
|
|
|
|
|
|
- name: Test with TEST_MATHLIB_VALUE
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE check
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
check_nonneg:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-05 21:36:53 +02:00
|
|
|
# coreutils contains "g++" (default is "c++") and "nproc"
|
2022-09-02 15:56:17 +02:00
|
|
|
- name: Install missing software on macos
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
brew install coreutils
|
|
|
|
|
2021-02-21 14:17:02 +01:00
|
|
|
- name: Check syntax with NONNEG
|
|
|
|
run: |
|
|
|
|
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
build_qmake:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-02 15:56:17 +02:00
|
|
|
|
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev qtchooser
|
|
|
|
|
|
|
|
# coreutils contains "nproc"
|
|
|
|
- name: Install missing software on macos
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
|
|
|
brew install coreutils qt@5
|
2022-09-15 20:26:21 +02:00
|
|
|
# expose qmake
|
|
|
|
brew link qt@5 --force
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-03 21:21:24 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-09-15 20:26:21 +02:00
|
|
|
- name: Build GUI
|
2022-09-02 15:56:17 +02:00
|
|
|
run: |
|
2022-09-15 20:26:21 +02:00
|
|
|
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2022-09-02 15:56:17 +02:00
|
|
|
pushd gui
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache HAVE_QCHART=yes
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
|
|
|
|
2022-09-15 20:26:21 +02:00
|
|
|
# TODO: binaries are in a different location on macos
|
|
|
|
- name: Build and Run GUI tests
|
2022-09-02 15:56:17 +02:00
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
2022-09-15 20:26:21 +02:00
|
|
|
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2022-09-02 15:56:17 +02:00
|
|
|
pushd gui/test/cppchecklibrarydata
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
|
|
|
./test-cppchecklibrarydata
|
|
|
|
popd
|
|
|
|
pushd gui/test/filelist
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
2023-01-27 19:43:08 +01:00
|
|
|
./test-filelist
|
2022-09-02 15:56:17 +02:00
|
|
|
popd
|
|
|
|
pushd gui/test/projectfile
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
|
|
|
./test-projectfile
|
|
|
|
popd
|
|
|
|
pushd gui/test/translationhandler
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
2023-01-27 19:43:08 +01:00
|
|
|
# TODO: requires X session because of QApplication dependency in translationhandler.cpp
|
2022-09-02 15:56:17 +02:00
|
|
|
#./test-translationhandler
|
|
|
|
popd
|
|
|
|
pushd gui/test/xmlreportv2
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
2023-01-27 19:43:08 +01:00
|
|
|
./test-xmlreportv2
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-15 20:26:21 +02:00
|
|
|
- name: Generate Qt help file
|
2022-09-02 15:56:17 +02:00
|
|
|
run: |
|
|
|
|
pushd gui/help
|
|
|
|
qhelpgenerator online-help.qhcp -o online-help.qhc
|
|
|
|
|
2022-09-15 20:26:21 +02:00
|
|
|
- name: Build triage
|
2022-09-02 15:56:17 +02:00
|
|
|
run: |
|
2022-09-15 20:26:21 +02:00
|
|
|
export PATH="$(brew --prefix)/opt/ccache/libexec:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2022-09-02 15:56:17 +02:00
|
|
|
pushd tools/triage
|
2022-09-15 20:26:21 +02:00
|
|
|
qmake CONFIG+=debug CONFIG+=ccache
|
2022-09-02 15:56:17 +02:00
|
|
|
make -j$(nproc)
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
|
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2022-09-03 21:21:24 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libxml2-utils
|
|
|
|
|
|
|
|
# packages for strict cfg checks
|
|
|
|
- name: Install missing software on ubuntu 22.04 (cfg)
|
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install libcairo2-dev libcurl4-openssl-dev liblua5.3-dev libssl-dev libsqlite3-dev libcppunit-dev libsigc++-2.0-dev libgtk-3-dev libboost-all-dev libwxgtk3.0-gtk3-dev xmlstarlet qtbase5-dev
|
|
|
|
|
|
|
|
# coreutils contains "nproc"
|
|
|
|
- name: Install missing software on macos
|
|
|
|
if: contains(matrix.os, 'macos')
|
|
|
|
run: |
|
2022-11-25 15:11:57 +01:00
|
|
|
# pcre was removed from runner images in November 2022
|
2023-03-02 20:54:30 +01:00
|
|
|
brew install coreutils python3 pcre gnu-sed
|
2022-09-02 15:56:17 +02:00
|
|
|
|
|
|
|
- name: Install missing Python packages
|
|
|
|
run: |
|
|
|
|
python3 -m pip install pip --upgrade
|
|
|
|
python3 -m pip install pytest
|
2023-08-30 19:35:43 +02:00
|
|
|
python3 -m pip install pytest-timeout
|
2022-09-02 15:56:17 +02:00
|
|
|
|
2020-02-20 22:00:14 +01:00
|
|
|
- name: Build cppcheck
|
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2022-04-11 07:30:55 +02:00
|
|
|
make -j$(nproc) HAVE_RULES=yes
|
2020-02-20 22:00:14 +01:00
|
|
|
|
|
|
|
- name: Build test
|
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2022-04-11 07:30:55 +02:00
|
|
|
make -j$(nproc) testrunner HAVE_RULES=yes
|
2020-02-20 22:00:14 +01:00
|
|
|
|
2020-05-03 10:10:39 +02:00
|
|
|
- name: Run test
|
2020-02-20 22:00:14 +01:00
|
|
|
run: |
|
2022-04-11 07:30:55 +02:00
|
|
|
make -j$(nproc) check HAVE_RULES=yes
|
2020-02-20 22:00:14 +01:00
|
|
|
|
2023-03-02 20:54:30 +01:00
|
|
|
# requires "gnu-sed" installed on macos
|
2021-04-03 21:22:39 +02:00
|
|
|
- name: Run extra tests
|
2021-03-01 18:49:59 +01:00
|
|
|
run: |
|
2021-04-03 21:22:39 +02:00
|
|
|
tools/generate_and_run_more_tests.sh
|
|
|
|
|
2022-05-31 19:53:50 +02:00
|
|
|
# do not use pushd in this step since we go below the working directory
|
2021-04-03 21:22:39 +02:00
|
|
|
- name: Run test/cli
|
|
|
|
run: |
|
|
|
|
cd test/cli
|
2023-09-26 15:31:37 +02:00
|
|
|
python3 -m pytest -Werror --strict-markers -vv test-*.py
|
2021-04-03 21:22:39 +02:00
|
|
|
cd ../../..
|
|
|
|
ln -s cppcheck 'cpp check'
|
|
|
|
cd 'cpp check/test/cli'
|
2023-09-26 15:31:37 +02:00
|
|
|
python3 -m pytest -Werror --strict-markers -vv test-*.py
|
2021-03-01 18:49:59 +01:00
|
|
|
|
2021-04-09 07:47:11 +02:00
|
|
|
- name: Run cfg tests
|
2023-03-02 20:54:30 +01:00
|
|
|
if: matrix.os != 'ubuntu-22.04'
|
2022-05-10 13:03:58 +02:00
|
|
|
run: |
|
|
|
|
make -j$(nproc) checkcfg
|
|
|
|
|
|
|
|
- name: Run cfg tests (strict)
|
2022-05-31 19:55:57 +02:00
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
2021-04-09 07:47:11 +02:00
|
|
|
run: |
|
|
|
|
make -j$(nproc) checkcfg
|
2022-05-10 13:03:58 +02:00
|
|
|
env:
|
|
|
|
STRICT: 1
|
2021-04-09 07:47:11 +02:00
|
|
|
|
|
|
|
- name: Run showtimetop5 tests
|
|
|
|
run: |
|
|
|
|
./tools/test_showtimetop5.sh
|
|
|
|
|
|
|
|
- name: Run --dump test
|
|
|
|
run: |
|
|
|
|
./cppcheck test/testpreprocessor.cpp --dump
|
|
|
|
xmllint --noout test/testpreprocessor.cpp.dump
|
|
|
|
|
2020-02-20 22:00:14 +01:00
|
|
|
- name: Validate
|
|
|
|
run: |
|
2021-02-21 14:17:02 +01:00
|
|
|
make -j$(nproc) checkCWEEntries validateXML
|
|
|
|
|
2022-05-31 19:53:50 +02:00
|
|
|
# TODO: move to scriptcheck.yml so these are tested with all Python versions?
|
2020-10-23 11:58:25 +02:00
|
|
|
- name: Test addons
|
|
|
|
run: |
|
2023-06-08 14:46:09 +02:00
|
|
|
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety addons/test/threadsafety
|
|
|
|
./cppcheck --error-exitcode=1 --inline-suppr --addon=threadsafety --std=c++03 addons/test/threadsafety
|
2023-07-10 12:25:28 +02:00
|
|
|
./cppcheck --error-exitcode=1 --inline-suppr --addon=misra addons/test/misra/crash*.c
|
2023-05-27 10:24:00 +02:00
|
|
|
./cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 addons/test/misra/misra-ctu-*-test.c
|
2022-05-31 19:53:50 +02:00
|
|
|
pushd addons/test
|
|
|
|
# We'll force C89 standard to enable an additional verification for
|
|
|
|
# rules 5.4 and 5.5 which have standard-dependent options.
|
|
|
|
../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64
|
|
|
|
python3 ../misra.py -verify misra/misra-test.c.dump
|
|
|
|
# TODO: do we need to verify something here?
|
|
|
|
../../cppcheck --dump -DDUMMY --suppress=uninitvar --suppress=uninitStructMember --std=c89 misra/misra-test.h
|
|
|
|
../../cppcheck --dump misra/misra-test.cpp
|
|
|
|
python3 ../misra.py -verify misra/misra-test.cpp.dump
|
|
|
|
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_ascii.txt -verify misra/misra-test.cpp.dump
|
|
|
|
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_utf8.txt -verify misra/misra-test.cpp.dump
|
|
|
|
python3 ../misra.py --rule-texts=misra/misra2012_rules_dummy_windows1250.txt -verify misra/misra-test.cpp.dump
|
2023-05-27 10:24:00 +02:00
|
|
|
../../cppcheck --addon=misra --enable=style --platform=avr8 --error-exitcode=1 misra/misra-test-avr8.c
|
2022-05-31 19:53:50 +02:00
|
|
|
../../cppcheck --dump misc-test.cpp
|
|
|
|
python3 ../misc.py -verify misc-test.cpp.dump
|
|
|
|
../../cppcheck --dump naming_test.c
|
|
|
|
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.c.dump
|
|
|
|
../../cppcheck --dump naming_test.cpp
|
|
|
|
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump
|
|
|
|
../../cppcheck --dump namingng_test.c
|
|
|
|
python3 ../namingng.py --configfile ../naming.json --verify namingng_test.c.dump
|
2020-09-05 18:29:19 +02:00
|
|
|
|
2023-04-21 18:58:04 +02:00
|
|
|
- name: Build democlient
|
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
|
|
run: |
|
|
|
|
warnings="-pedantic -Wall -Wextra -Wcast-qual -Wno-deprecated-declarations -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wundef -Wno-shadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar"
|
|
|
|
g++ $warnings -c -Ilib -Iexternals/tinyxml2 democlient/democlient.cpp
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
selfcheck:
|
|
|
|
needs: build # wait for all tests to be successful first
|
2020-07-30 10:36:06 +02:00
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
runs-on: ubuntu-22.04 # run on the latest image only
|
2020-10-11 03:48:34 +02:00
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-12-19 12:36:11 +01:00
|
|
|
|
2022-09-03 21:21:24 +02:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
|
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
- name: Install missing software on ubuntu
|
2021-12-19 12:36:11 +01:00
|
|
|
run: |
|
2022-09-02 15:56:17 +02:00
|
|
|
sudo apt-get update
|
2022-09-27 18:49:18 +02:00
|
|
|
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev libboost-container-dev
|
2021-12-19 12:36:11 +01:00
|
|
|
|
2021-12-17 21:52:55 +01:00
|
|
|
- name: Self check (build)
|
2020-09-05 18:29:19 +02:00
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2020-09-05 18:29:19 +02:00
|
|
|
# compile with verification and ast matchers
|
2022-09-27 18:49:18 +02:00
|
|
|
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
|
2021-12-17 21:52:55 +01:00
|
|
|
|
2022-09-02 15:56:17 +02:00
|
|
|
- name: Generate UI files
|
|
|
|
run: |
|
|
|
|
pushd gui
|
|
|
|
qmake CONFIG+=debug HAVE_QCHART=yes
|
|
|
|
make -j$(nproc) compiler_uic_make_all mocables
|
|
|
|
|
2022-09-06 23:11:39 +02:00
|
|
|
- name: Generate triage UI files
|
|
|
|
run: |
|
|
|
|
pushd tools/triage
|
|
|
|
qmake CONFIG+=debug
|
|
|
|
make -j$(nproc) compiler_uic_make_all mocables
|
|
|
|
|
2021-12-17 21:52:55 +01:00
|
|
|
- name: Self check
|
|
|
|
run: |
|
2023-09-11 19:59:58 +02:00
|
|
|
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5 -D__CPPCHECK__ -D__GNUC__ -DCHECK_INTERNAL -DHAVE_RULES --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings --check-level=exhaustive"
|
2022-05-13 06:52:20 +02:00
|
|
|
ec=0
|
2022-09-06 23:11:39 +02:00
|
|
|
|
2023-08-14 10:29:04 +02:00
|
|
|
# TODO: add --check-config
|
|
|
|
|
2022-09-06 23:11:39 +02:00
|
|
|
# early exit
|
|
|
|
if [ $ec -eq 1 ]; then
|
|
|
|
exit $ec
|
|
|
|
fi
|
|
|
|
|
2020-09-05 18:29:19 +02:00
|
|
|
# self check lib/cli
|
|
|
|
mkdir b1
|
2022-09-24 22:14:04 +02:00
|
|
|
./cppcheck $selfcheck_options --cppcheck-build-dir=b1 --addon=naming.json -DCHECK_INTERNAL cli lib || ec=1
|
2020-09-05 18:29:19 +02:00
|
|
|
# check gui with qt settings
|
|
|
|
mkdir b2
|
2023-03-13 15:44:00 +01:00
|
|
|
./cppcheck $selfcheck_options --cppcheck-build-dir=b2 -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt --addon=naming.json -Igui/temp -Igui gui/*.cpp gui/temp/*.cpp || ec=1
|
2020-09-05 18:29:19 +02:00
|
|
|
# self check test and tools
|
2022-09-06 23:11:39 +02:00
|
|
|
./cppcheck $selfcheck_options -Icli test/*.cpp tools/*.cpp || ec=1
|
2022-03-11 21:42:46 +01:00
|
|
|
# triage
|
2023-03-13 15:44:00 +01:00
|
|
|
./cppcheck $selfcheck_options -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt -Itools/triage/temp -Igui tools/triage/*.cpp tools/triage/temp/*.cpp || ec=1
|
2023-04-09 13:48:13 +02:00
|
|
|
exit $ec
|