From deaba1769126dd6873589d626e7c01abe85d1d29 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 11 Feb 2021 17:34:41 +0100 Subject: [PATCH] TT#111150 Add github workflows for various code checkers This adds support for running cppcheck, clang-analyzer, and running the tests using various compiler sanitizers. Change-Id: I931af6460c60bccd3d1429e84ef8653f907ecf38 --- .github/workflows/clang-analyze.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/cppcheck.yml | 19 +++++++++++++++++++ .github/workflows/sanitizers.yml | 24 ++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 .github/workflows/clang-analyze.yml create mode 100644 .github/workflows/cppcheck.yml create mode 100644 .github/workflows/sanitizers.yml diff --git a/.github/workflows/clang-analyze.yml b/.github/workflows/clang-analyze.yml new file mode 100644 index 0000000..46eacfc --- /dev/null +++ b/.github/workflows/clang-analyze.yml @@ -0,0 +1,28 @@ +name: Clang Analyze + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Get build dependencies + run: | + sudo apt-get install -qq -y --no-install-recommends clang-tools + sudo apt-get build-dep -qq -y . + + - name: Analyze + run: | + scan-build -o clang-analyze/ make + + - name: Store artifacts + uses: actions/upload-artifact@v2 + with: + name: Clang Analyze results + path: clang-analyze/ diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 0000000..4d9ea36 --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,19 @@ +name: Cppcheck + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Get tool + run: sudo apt-get install -qq -y --no-install-recommends cppcheck + + - name: Analyze + run: cppcheck -q --enable=all src diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml new file mode 100644 index 0000000..e0dc2b0 --- /dev/null +++ b/.github/workflows/sanitizers.yml @@ -0,0 +1,24 @@ +name: Sanitizers + +on: + push: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-20.04 + + env: + FLAGS: "-fsanitize=address -fsanitize=leak -fsanitize=undefined" + + steps: + - name: Checkout source + uses: actions/checkout@v2 + + - name: Get build dependencies + run: | + sudo apt-get build-dep -qq -y . + + - name: Build with sanitizers enabled + run: | + CFLAGS="$FLAGS" LDFLAGS="$FLAGS" make test