1name: checkstyle
2
3on:
4  push:
5  pull_request:
6
7jobs:
8  checkstyle:
9    runs-on: ubuntu-18.04
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 apt-get install --yes -qq build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r)
18        sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev python-dev python-setuptools python-cffi python3 python3-dev python3-setuptools python3-cffi
19        # packages for tests
20        sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
21        sudo apt-get install --yes -qq mandoc cppcheck pax-utils devscripts
22        sudo -E pip --quiet install flake8
23    - name: Prepare
24      run: |
25        sh ./autogen.sh
26        ./configure
27        make -j$(nproc)
28    - name: Checkstyle
29      run: |
30        make checkstyle
31    - name: Lint
32      run: |
33        make lint
34    - name: CheckABI
35      id: CheckABI
36      run: |
37        sudo docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make checkabi
38    - name: StoreABI
39      if: failure() && steps.CheckABI.outcome == 'failure'
40      run: |
41        sudo docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make storeabi
42    - name: Prepare artifacts
43      if: failure() && steps.CheckABI.outcome == 'failure'
44      run: |
45        find -name *.abi | tar -cf abi_files.tar -T -
46    - uses: actions/upload-artifact@v2
47      if: failure() && steps.CheckABI.outcome == 'failure'
48      with:
49        name: New ABI files (use only if you're sure about interface changes)
50        path: abi_files.tar
51