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
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-10-24 11:07:45 +02:00
|
|
|
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:21.10"]
|
2021-02-20 13:23:57 +01:00
|
|
|
fail-fast: false # Prefer quick result
|
|
|
|
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
container:
|
|
|
|
image: ${{ matrix.image }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install missing software on CentOS 7
|
|
|
|
if: matrix.image == 'centos:7'
|
|
|
|
run: |
|
|
|
|
yum install -y cmake gcc-c++ make
|
|
|
|
yum install -y pcre-devel
|
|
|
|
|
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
if: matrix.image != 'centos:7'
|
|
|
|
run: |
|
|
|
|
apt-get update
|
2021-02-21 14:17:02 +01:00
|
|
|
apt-get install -y cmake g++ make python libxml2-utils
|
2021-02-20 13:23:57 +01:00
|
|
|
apt-get install -y libpcre3-dev
|
|
|
|
|
|
|
|
# tests require CMake 3.4
|
|
|
|
- name: Test CMake build (no tests)
|
2021-10-24 11:07:45 +02:00
|
|
|
if: matrix.image != 'ubuntu:21.10'
|
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)
|
2021-02-20 13:23:57 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
- name: Test CMake build
|
2021-10-24 11:07:45 +02:00
|
|
|
if: matrix.image == 'ubuntu:21.10'
|
2021-02-20 13:23:57 +01:00
|
|
|
run: |
|
|
|
|
mkdir cmake.output
|
|
|
|
cd cmake.output
|
|
|
|
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On ..
|
2021-12-15 19:36:34 +01:00
|
|
|
cmake --build . --target check -- -j$(nproc)
|
2021-02-20 13:23:57 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
- name: Build cppcheck
|
|
|
|
run: |
|
|
|
|
make clean
|
|
|
|
make -j$(nproc) HAVE_RULES=yes
|
|
|
|
|
|
|
|
- name: Build test
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) testrunner HAVE_RULES=yes
|
|
|
|
|
|
|
|
- name: Run test
|
|
|
|
run: |
|
|
|
|
make -j$(nproc) check HAVE_RULES=yes
|
|
|
|
|
2021-04-03 21:22:39 +02:00
|
|
|
- name: Run extra tests
|
|
|
|
run: |
|
|
|
|
tools/generate_and_run_more_tests.sh
|
|
|
|
|
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
|