aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/checkstyle.yaml
blob: abc0ff11916a9a4da5e606bd845198693e079c03 (plain)
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
53
54
55
56
name: checkstyle

on:
  push:
  pull_request:

jobs:
  checkstyle:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        ref: ${{ github.event.pull_request.head.sha }}
    - name: Install dependencies
      run: |
        sudo apt-get update
        sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
        sudo apt-get install -qq mandoc cppcheck pax-utils devscripts
        sudo python3 -m pip install --quiet flake8
        sudo apt-get clean

        # confirm that the tools are installed
        # the build system doesn't fail when they are not
        checkbashisms --version
        cppcheck --version
        flake8 --version
        scanelf --version
        shellcheck --version
    - name: Prepare
      run: |
        ./autogen.sh
        ./configure
        make -j$(nproc) --no-print-directory --silent
    - name: Checkstyle
      run: |
        make -j$(nproc) --no-print-directory --silent checkstyle
    - name: Lint
      run: |
        make -j$(nproc) --no-print-directory --silent lint
    - name: CheckABI
      id: CheckABI
      run: |
        docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent checkabi
    - name: StoreABI
      if: failure() && steps.CheckABI.outcome == 'failure'
      run: |
        docker run -v $(pwd):/source ghcr.io/openzfs/libabigail make -j$(nproc) --no-print-directory --silent storeabi
    - name: Prepare artifacts
      if: failure() && steps.CheckABI.outcome == 'failure'
      run: |
        find -name *.abi | tar -cf abi_files.tar -T -
    - uses: actions/upload-artifact@v2
      if: failure() && steps.CheckABI.outcome == 'failure'
      with:
        name: New ABI files (use only if you're sure about interface changes)
        path: abi_files.tar