xref: /freebsd/sys/contrib/openzfs/.github/workflows/checkstyle.yaml (revision c03c5b1c80914ec656fbee84539355d1fad68bf9)
1name: checkstyle
2
3on:
4  push:
5  pull_request:
6
7jobs:
8  checkstyle:
9    runs-on: ubuntu-latest
10    steps:
11    - uses: actions/checkout@v2
12      with:
13        ref: ${{ github.event.pull_request.head.sha }}
14    - name: Install dependencies
15      run: |
16        sudo apt-get update
17        sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
18        sudo apt-get install -qq mandoc cppcheck pax-utils devscripts
19        sudo python3 -m pip install --quiet flake8
20        sudo apt-get clean
21
22        # confirm that the tools are installed
23        # the build system doesn't fail when they are not
24        checkbashisms --version
25        cppcheck --version
26        flake8 --version
27        scanelf --version
28        shellcheck --version
29    - name: Prepare
30      run: |
31        ./autogen.sh
32        ./configure
33        make -j$(nproc) --no-print-directory --silent
34    - name: Checkstyle
35      run: |
36        make -j$(nproc) --no-print-directory --silent checkstyle
37    - name: Lint
38      run: |
39        make -j$(nproc) --no-print-directory --silent lint
40    - name: CheckABI
41      id: CheckABI
42      run: |
43        docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent checkabi
44    - name: StoreABI
45      if: failure() && steps.CheckABI.outcome == 'failure'
46      run: |
47        docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent storeabi
48    - name: Prepare artifacts
49      if: failure() && steps.CheckABI.outcome == 'failure'
50      run: |
51        find -name *.abi | tar -cf abi_files.tar -T -
52    - uses: actions/upload-artifact@v2
53      if: failure() && steps.CheckABI.outcome == 'failure'
54      with:
55        name: New ABI files (use only if you're sure about interface changes)
56        path: abi_files.tar
57