2021-02-20 13:23:57 +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
|
|
|
|
name: CI-unixish-docker
|
|
|
|
|
2023-09-01 18:52:20 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'releases/**'
|
|
|
|
tags:
|
|
|
|
- '2.*'
|
|
|
|
pull_request:
|
2021-02-20 13:23:57 +01:00
|
|
|
|
2022-08-26 23:25:07 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-02-20 13:23:57 +01:00
|
|
|
jobs:
|
2022-08-29 12:27:23 +02:00
|
|
|
build_cmake:
|
2021-02-20 13:23:57 +01:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-04-21 10:12:18 +02:00
|
|
|
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.04"]
|
2021-02-20 13:23:57 +01:00
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
2022-05-31 19:55:57 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-02-20 13:23:57 +01:00
|
|
|
|
2023-04-08 22:21:11 +02:00
|
|
|
# TODO: is this actually applied to the guest?
|
|
|
|
env:
|
|
|
|
# TODO: figure out why there are cache misses with PCH enabled
|
|
|
|
CCACHE_SLOPPINESS: pch_defines,time_macros
|
|
|
|
|
2021-02-20 13:23:57 +01:00
|
|
|
container:
|
|
|
|
image: ${{ matrix.image }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-02-20 13:23:57 +01:00
|
|
|
|
|
|
|
- name: Install missing software on CentOS 7
|
|
|
|
if: matrix.image == 'centos:7'
|
|
|
|
run: |
|
2022-08-29 12:27:23 +02:00
|
|
|
yum install -y cmake gcc-c++ make pcre-devel
|
2022-09-04 10:27:20 +02:00
|
|
|
yum --enablerepo=extras install -y epel-release
|
|
|
|
yum install -y ccache
|
2021-02-20 13:23:57 +01:00
|
|
|
|
|
|
|
- name: Install missing software on ubuntu
|
2022-09-04 10:27:20 +02:00
|
|
|
if: contains(matrix.image, 'ubuntu')
|
2021-02-20 13:23:57 +01:00
|
|
|
run: |
|
|
|
|
apt-get update
|
2022-08-29 12:27:23 +02:00
|
|
|
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
|
2021-02-20 13:23:57 +01:00
|
|
|
|
2022-08-27 15:05:40 +02:00
|
|
|
# required so a default Qt installation is configured
|
|
|
|
- name: Install missing software on ubuntu 18.04
|
|
|
|
if: false # matrix.os == 'ubuntu-18.04'
|
|
|
|
run: |
|
|
|
|
sudo apt-get install qt5-default
|
|
|
|
|
2022-09-04 10:27:20 +02:00
|
|
|
# needs to be called after the package installation since
|
|
|
|
# - it doesn't call "apt-get update"
|
|
|
|
# - it doesn't support centos
|
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ matrix.image }}
|
|
|
|
|
|
|
|
# tests require CMake 3.9 - no ccache available
|
2022-10-22 00:27:42 +02:00
|
|
|
- name: CMake build (no tests / no ccache)
|
2022-09-04 10:27:20 +02:00
|
|
|
if: matrix.image == 'ubuntu:14.04'
|
2021-02-20 13:23:57 +01:00
|
|
|
run: |
|
|
|
|
mkdir cmake.output
|
|
|
|
cd cmake.output
|
|
|
|
cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
|
2021-12-15 19:36:34 +01:00
|
|
|
cmake --build . -- -j$(nproc)
|
2022-09-04 10:27:20 +02:00
|
|
|
|
|
|
|
# tests require CMake 3.9 - ccache available
|
2022-09-26 18:21:43 +02:00
|
|
|
- name: CMake build (no tests)
|
2022-09-04 16:04:31 +02:00
|
|
|
if: matrix.image == 'centos:7' || matrix.image == 'ubuntu:16.04'
|
2022-09-04 10:27:20 +02:00
|
|
|
run: |
|
|
|
|
mkdir cmake.output
|
|
|
|
cd cmake.output
|
2023-04-08 22:21:11 +02:00
|
|
|
cmake -G "Unix Makefiles" -DHAVE_RULES=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 . -- -j$(nproc)
|
2021-02-20 13:23:57 +01:00
|
|
|
|
2022-09-26 18:21:43 +02:00
|
|
|
- name: CMake build
|
2022-09-04 10:27:20 +02:00
|
|
|
if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04'
|
2021-02-20 13:23:57 +01:00
|
|
|
run: |
|
|
|
|
mkdir cmake.output
|
|
|
|
cd cmake.output
|
2023-04-08 22:21:11 +02:00
|
|
|
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
|
2022-09-26 18:21:43 +02:00
|
|
|
cmake --build . -- -j$(nproc)
|
|
|
|
|
|
|
|
- name: Run CMake test
|
|
|
|
if: matrix.image != 'centos:7' && matrix.image != 'ubuntu:14.04' && matrix.image != 'ubuntu:16.04'
|
|
|
|
run: |
|
|
|
|
cmake --build cmake.output --target check -- -j$(nproc)
|
2021-02-20 13:23:57 +01:00
|
|
|
|
2022-08-29 12:27:23 +02:00
|
|
|
build_make:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-08-29 17:47:57 +02:00
|
|
|
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:18.04", "ubuntu:23.04"]
|
2022-08-29 12:27:23 +02:00
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
|
|
|
|
container:
|
|
|
|
image: ${{ matrix.image }}
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-29 12:27:23 +02:00
|
|
|
|
|
|
|
- name: Install missing software on CentOS 7
|
|
|
|
if: matrix.image == 'centos:7'
|
|
|
|
run: |
|
|
|
|
yum install -y gcc-c++ make which python3 pcre-devel
|
2022-09-03 21:21:24 +02:00
|
|
|
yum --enablerepo=extras install -y epel-release
|
|
|
|
yum install -y ccache
|
2022-08-29 12:27:23 +02:00
|
|
|
|
|
|
|
- name: Install missing software on ubuntu
|
2022-09-04 10:27:20 +02:00
|
|
|
if: contains(matrix.image, 'ubuntu')
|
2022-08-29 12:27:23 +02:00
|
|
|
run: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev
|
|
|
|
|
2022-09-03 21:21:24 +02:00
|
|
|
# needs to be called after the package installation since
|
|
|
|
# - it doesn't call "apt-get update"
|
|
|
|
# - it doesn't support centos
|
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
if: matrix.image != 'ubuntu:14.04' # no support for --set-config
|
|
|
|
with:
|
|
|
|
key: ${{ github.workflow }}-${{ matrix.image }}
|
|
|
|
|
2021-02-20 13:23:57 +01:00
|
|
|
- name: Build cppcheck
|
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
# "/usr/lib64" for centos / "/usr/lib" for ubuntu
|
|
|
|
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2023-10-09 12:25:56 +02:00
|
|
|
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
|
2021-02-20 13:23:57 +01:00
|
|
|
|
|
|
|
- name: Build test
|
|
|
|
run: |
|
2022-09-03 21:21:24 +02:00
|
|
|
# "/usr/lib64" for centos / "/usr/lib" for ubuntu
|
|
|
|
export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
2023-10-09 12:25:56 +02:00
|
|
|
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
|
2021-02-20 13:23:57 +01:00
|
|
|
|
|
|
|
- name: Run test
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) check HAVE_RULES=yes
|
|
|
|
|
2022-08-29 12:27:23 +02:00
|
|
|
# requires python3
|
2021-04-03 21:22:39 +02:00
|
|
|
- name: Run extra tests
|
|
|
|
run: |
|
|
|
|
tools/generate_and_run_more_tests.sh
|
|
|
|
|
2022-08-29 12:27:23 +02:00
|
|
|
# requires which
|
2021-02-21 14:17:02 +01:00
|
|
|
- name: Validate
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) checkCWEEntries validateXML
|
|
|
|
|
2021-02-20 13:23:57 +01:00
|
|
|
- name: Test addons
|
|
|
|
run: |
|
|
|
|
./cppcheck --addon=threadsafety addons/test/threadsafety
|
|
|
|
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
|
2022-09-02 15:56:17 +02:00
|
|
|
|
|
|
|
- name: Generate Qt help file on ubuntu 18.04
|
|
|
|
if: false # matrix.os == 'ubuntu-18.04'
|
|
|
|
run: |
|
|
|
|
pushd gui/help
|
|
|
|
qcollectiongenerator online-help.qhcp -o online-help.qhc
|
|
|
|
|