summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/.github/workflows/scanbuild.yml
blob: 472b0b7e396a5f7f62540cc0b037fa4ae93fcac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Linux Static Analyzer Build

on:
    push:
      # Pushes to this branch get the scan-build treatment
      branches:
         - 'scan-build*'

    pull_request:
      # Changing this build gets it to run
      paths:
         - '.github/workflows/scanbuild.yml'

jobs:
    unix:
        runs-on: ${{ matrix.os }}
        strategy:
            fail-fast: false
            matrix:
                name: [linux-clang]
                include:
                    - name: linux-clang
                      os: ubuntu-22.04
                      compiler: clang
        steps:
            - name: Clone repository
              uses: actions/checkout@v1
            - name: Install packages
              if: startsWith(matrix.os, 'ubuntu')
              run: |
                sudo apt-get update -qq
                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 python3 ss-dev texinfo unzip netbase keyutils ldap-utils gdb apport curl libmicrohttpd-dev clang-tools clang-format jq valgrind
                # Temporary workaround for:
                # https://github.com/actions/virtual-environments/issues/3185
                sudo hostname localhost
            - name: Build
              env:
                CC: ${{ matrix.compiler }}
                MAKEVARS: ${{ matrix.makevars }}
                CONFIGURE_OPTS:  ${{ matrix.configureopts }}
              run: |
                /bin/sh ./autogen.sh
                mkdir build
                cd build
                ../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"
                ulimit -c unlimited
                # We don't want to scan-build libedit nor SQLite3 because ETOOSLOW
                (cd lib/libedit && make -j4)
                (cd lib/sqlite && make -j4)
                scan-build --keep-going make -j4
            - name: Test
              env:
                CC: ${{ matrix.compiler }}
                MAKEVARS: ${{ matrix.makevars }}
              run: |
                cd build
                ulimit -c unlimited
                scan-build --keep-going make check
            - name: Failed Test logs
              if: ${{ failure() }}
              run: |
                find build -name \*.trs|xargs grep -lw FAIL|sed -e 's/trs$/log/'|xargs cat
            - name: Upload Artifacts
              uses: actions/upload-artifact@v2
              with:
                name: Scan-Build Reports
                path: '/tmp/scan-build*/'