| 1 |
name: Linux Static Analyzer Build |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
# Pushes to this branch get the scan-build treatment |
| 6 |
branches: |
| 7 |
- 'scan-build*' |
| 8 |
|
| 9 |
pull_request: |
| 10 |
# Changing this build gets it to run |
| 11 |
paths: |
| 12 |
- '.github/workflows/scanbuild.yml' |
| 13 |
|
| 14 |
jobs: |
| 15 |
unix: |
| 16 |
runs-on: ${{ matrix.os }} |
| 17 |
strategy: |
| 18 |
fail-fast: false |
| 19 |
matrix: |
| 20 |
name: [linux-clang] |
| 21 |
include: |
| 22 |
- name: linux-clang |
| 23 |
os: ubuntu-18.04 |
| 24 |
compiler: clang |
| 25 |
steps: |
| 26 |
- name: Clone repository |
| 27 |
uses: actions/checkout@v1 |
| 28 |
- name: Install packages |
| 29 |
if: startsWith(matrix.os, 'ubuntu') |
| 30 |
run: | |
| 31 |
sudo apt-get update -qq |
| 32 |
sudo apt-get install -y bison comerr-dev flex libcap-ng-dev libdb-dev libedit-dev libjson-perl libldap2-dev libncurses5-dev libperl4-corelibs-perl libsqlite3-dev libkeyutils-dev pkg-config python ss-dev texinfo unzip netbase keyutils ldap-utils gdb apport curl libmicrohttpd-dev clang-tools clang-format jq valgrind |
| 33 |
# Temporary workaround for: |
| 34 |
# https://github.com/actions/virtual-environments/issues/3185 |
| 35 |
sudo hostname localhost |
| 36 |
- name: Build |
| 37 |
env: |
| 38 |
CC: ${{ matrix.compiler }} |
| 39 |
MAKEVARS: ${{ matrix.makevars }} |
| 40 |
CONFIGURE_OPTS: ${{ matrix.configureopts }} |
| 41 |
run: | |
| 42 |
/bin/sh ./autogen.sh |
| 43 |
mkdir build |
| 44 |
cd build |
| 45 |
../configure --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="-Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations" |
| 46 |
ulimit -c unlimited |
| 47 |
# We don't want to scan-build libedit nor SQLite3 because ETOOSLOW |
| 48 |
(cd lib/libedit && make -j4) |
| 49 |
(cd lib/sqlite && make -j4) |
| 50 |
scan-build --keep-going make -j4 |
| 51 |
- name: Test |
| 52 |
env: |
| 53 |
CC: ${{ matrix.compiler }} |
| 54 |
MAKEVARS: ${{ matrix.makevars }} |
| 55 |
run: | |
| 56 |
cd build |
| 57 |
ulimit -c unlimited |
| 58 |
scan-build --keep-going make check |
| 59 |
- name: Failed Test logs |
| 60 |
if: ${{ failure() }} |
| 61 |
run: | |
| 62 |
find build -name \*.trs|xargs grep -lw FAIL|sed -e 's/trs$/log/'|xargs cat |
| 63 |
- name: Upload Artifacts |
| 64 |
uses: actions/upload-artifact@v2 |
| 65 |
with: |
| 66 |
name: Scan-Build Reports |
| 67 |
path: '/tmp/scan-build*/' |