2023-06-01 10:09:39 -07:00
|
|
|
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
|
2023-06-13 00:53:01 -04:00
|
|
|
os: ubuntu-latest
|
2023-06-01 10:09:39 -07:00
|
|
|
compiler: clang
|
|
|
|
cflags: ''
|
|
|
|
steps:
|
|
|
|
- name: Clone repository
|
2023-09-18 18:19:51 +09:00
|
|
|
uses: actions/checkout@v4
|
2023-06-01 10:09:39 -07:00
|
|
|
- name: Open Submodule(s)
|
|
|
|
run: |
|
|
|
|
git submodule update --init --recursive
|
|
|
|
- name: Install packages
|
|
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get update -qq
|
2023-06-13 00:53:01 -04:00
|
|
|
sudo apt-get install -y automake autoconf bison flex gdb python3 valgrind clang-tools
|
2023-06-01 10:09:39 -07:00
|
|
|
- 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: |
|
2023-07-24 18:53:40 +02:00
|
|
|
autoreconf -i
|
2023-07-24 11:34:21 +02:00
|
|
|
./configure --with-oniguruma=builtin $COVERAGE
|
2023-06-01 10:09:39 -07:00
|
|
|
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
|
2024-01-09 09:33:26 +09:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-06-01 10:09:39 -07:00
|
|
|
with:
|
|
|
|
name: Scan-Build Reports
|
|
|
|
path: '/tmp/scan-build*/'
|