xref: /freebsd/sys/contrib/openzfs/.github/workflows/smatch.yml (revision d9497217456002b0ddad3cd319570d0b098daa29)
1name: smatch
2
3on:
4  push:
5  pull_request:
6    paths-ignore:
7      - 'man/**'
8      - '**.md'
9      - 'AUTHORS'
10      - 'COPYRIGHT'
11      - 'LICENSE'
12      - 'NOTICE'
13      - '.gitignore'
14
15concurrency:
16  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17  cancel-in-progress: true
18
19jobs:
20  smatch:
21    if: github.event_name == 'pull_request' || github.repository != 'openzfs/zfs'
22    runs-on: ubuntu-24.04
23    steps:
24    - name: Checkout smatch
25      uses: actions/checkout@v6
26      with:
27        repository: error27/smatch
28        ref: master
29        path: smatch
30    - name: Install smatch dependencies
31      run: |
32        sudo apt-get install -y llvm gcc make sqlite3 libsqlite3-dev libdbd-sqlite3-perl libssl-dev libtry-tiny-perl
33    - name: Make smatch
34      run: |
35        cd $GITHUB_WORKSPACE/smatch
36        make -j$(nproc)
37    - name: Checkout OpenZFS
38      uses: actions/checkout@v6
39      with:
40        ref: ${{ github.event.pull_request.head.sha }}
41        path: zfs
42    - name: Install OpenZFS dependencies
43      run: |
44        cd $GITHUB_WORKSPACE/zfs
45        sudo apt-get purge -y snapd google-chrome-stable firefox
46        ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps-vm.sh ubuntu24
47    - name: Autogen.sh OpenZFS
48      run: |
49        cd $GITHUB_WORKSPACE/zfs
50        ./autogen.sh
51    - name: Configure OpenZFS
52      run: |
53        cd $GITHUB_WORKSPACE/zfs
54        ./configure --enable-debug
55    - name: Make OpenZFS
56      run: |
57        cd $GITHUB_WORKSPACE/zfs
58        make -j$(nproc) CHECK="$GITHUB_WORKSPACE/smatch/smatch" CC=$GITHUB_WORKSPACE/smatch/cgcc | tee $GITHUB_WORKSPACE/smatch.log
59    - name: Smatch results log
60      run: |
61        grep -E 'error:|warn:|warning:' $GITHUB_WORKSPACE/smatch.log
62