summaryrefslogtreecommitdiffstats
path: root/.github/workflows/scanbuild.yml
blob: 6247a7da833af3906b7b72c7d1af74fd5ce1fbcf (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
68
69
70
71
72
73
74
75
76
77
name: Linux Clang scan-build Static Analyzer Build

on:
    # Don't do this for PRs.  It eats up minutes.
    push:
      branches:
         - 'master'
         - 'scan-build'
      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-18.04
                      compiler: clang
                      cflags: ''
        steps:
            - name: Clone repository
              uses: actions/checkout@v1
            - name: Open Submodule(s)
              run: |
                git submodule update --init --recursive
            - name: Install packages
              if: startsWith(matrix.os, 'ubuntu')
              run: |
                sudo apt-get update -qq
                sudo apt-get install -y automake autoconf bison flex gdb python valgrind clang-tools
            - name: Prep
              run: |
                #pyenv global 3.6.7
                #pip3 install pipenv
                #(cd docs && pipenv sync)
                #if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
                echo SHELL=$SHELL
                echo PATH=$PATH
                which bison
                bison --version

            - name: Build
              env:
                CC: ${{ matrix.compiler }}
                MAKEVARS: ${{ matrix.makevars }}
              run: |
                autoreconf -fi
                rm src/lexer.c src/lexer.h
                rm src/parser.c src/parser.h
                ./configure --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
                scan-build --keep-going make -j4
            - name: Test
              env:
                CC: ${{ matrix.compiler }}
                MAKEVARS: ${{ matrix.makevars }}
              run: |
                ulimit -c unlimited
                scan-build --keep-going make -j4 check
            - name: Core dump stacks
              run: |
                echo "thread apply all bt" > /tmp/x
                find . -name core -print | while read core; do gdb -batch -x x `file "$core"|sed -e "s/^[^']*'//" -e "s/[ '].*$//"` "$core"; done
                if [ "$(find . -name core -print | wc -l)" -gt 0 ]; then false; fi
            - name: Test logs
              if: ${{ failure() }}
              run: |
                cat test-suite.log
                cat tests/*.log
            - name: Upload Logs
              uses: actions/upload-artifact@v2
              with:
                name: Scan-Build Reports
                path: '/tmp/scan-build*/'