Fix and refactor scan-build workflow to run on the master branch (#3325)

This commit is contained in:
itchyny authored and GitHub committed 2025-05-20 20:00:53 +09:00
1 parent b733dfaee7
commit 4e2ccc4c9b
1 file changed
+43 -71
+43 -71
View File
@@ -1,75 +1,47 @@
name: Linux Clang scan-build Static Analyzer Build name: Clang scan-build Static Analyzer Build
on: on:
# Don't do this for PRs. It eats up minutes. push:
push: branches:
branches: - master
- 'master'
- 'scan-build'
paths:
- '.github/workflows/scanbuild.yml'
jobs: jobs:
unix: scan-build:
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy: steps:
fail-fast: false - name: Clone repository
matrix: uses: actions/checkout@v4
name: [linux-clang] with:
include: submodules: true
- name: linux-clang - name: Install packages
os: ubuntu-latest run: |
compiler: clang sudo apt-get update -qq
cflags: '' sudo apt-get install -y automake autoconf gdb valgrind clang clang-tools
steps: echo "CC=clang" >> "$GITHUB_ENV"
- name: Clone repository - name: Build
uses: actions/checkout@v4 run: |
- name: Open Submodule(s) autoreconf -i
run: | ./configure --enable-valgrind CFLAGS="-g -O0"
git submodule update --init --recursive scan-build --keep-going --exclude vendor/ make -j"$(nproc)"
- name: Install packages - name: Test
if: startsWith(matrix.os, 'ubuntu') run: |
run: | ulimit -c unlimited
sudo apt-get update -qq scan-build --keep-going --exclude vendor/ make -j"$(nproc)" check
sudo apt-get install -y automake autoconf bison flex gdb python3 valgrind clang-tools - name: Core dump stacks
- name: Prep run: |
run: | if [[ -f core ]]; then
#pyenv global 3.6.7 gdb -batch -ex "thread apply all bt" \
#pip3 install pipenv "$(file core | sed "s/^[^']*'//; s/[ '].*$//")" core
#(cd docs && pipenv sync) exit 1
#if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi fi
echo SHELL=$SHELL - name: Test logs
echo PATH=$PATH if: ${{ failure() }}
which bison run: |
bison --version cat test-suite.log tests/*.log
- name: Upload Logs
- name: Build uses: actions/upload-artifact@v4
env: with:
CC: ${{ matrix.compiler }} name: Scan-Build Reports
MAKEVARS: ${{ matrix.makevars }} path: /tmp/scan-build*
run: | if-no-files-found: ignore
autoreconf -i retention-days: 7
./configure --with-oniguruma=builtin --enable-valgrind $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@v4
with:
name: Scan-Build Reports
path: '/tmp/scan-build*/'