aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/.github/workflows/smatch.yml
blob: ac6454244f938cc12ba2970974160a934ccd1b8c (plain) (blame)
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
name: smatch

on:
  push:
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  smatch:
    runs-on: ubuntu-24.04
    steps:
    - name: Checkout smatch
      uses: actions/checkout@v4
      with:
        repository: error27/smatch
        ref: master
        path: smatch
    - name: Install smatch dependencies
      run: |
        sudo apt-get install -y llvm gcc make sqlite3 libsqlite3-dev libdbd-sqlite3-perl libssl-dev libtry-tiny-perl
    - name: Make smatch
      run: |
        cd $GITHUB_WORKSPACE/smatch
        make -j$(nproc)
    - name: Checkout OpenZFS
      uses: actions/checkout@v4
      with:
        ref: ${{ github.event.pull_request.head.sha }}
        path: zfs
    - name: Install OpenZFS dependencies
      run: |
        cd $GITHUB_WORKSPACE/zfs
        sudo apt-get purge -y snapd google-chrome-stable firefox
        ONLY_DEPS=1 .github/workflows/scripts/qemu-3-deps-vm.sh ubuntu24
    - name: Autogen.sh OpenZFS
      run: |
        cd $GITHUB_WORKSPACE/zfs
        ./autogen.sh
    - name: Configure OpenZFS
      run: |
        cd $GITHUB_WORKSPACE/zfs
        ./configure --enable-debug
    - name: Make OpenZFS
      run: |
        cd $GITHUB_WORKSPACE/zfs
        make -j$(nproc) CHECK="$GITHUB_WORKSPACE/smatch/smatch" CC=$GITHUB_WORKSPACE/smatch/cgcc | tee $GITHUB_WORKSPACE/smatch.log
    - name: Smatch results log
      run: |
        grep -E 'error:|warn:|warning:' $GITHUB_WORKSPACE/smatch.log