xref: /libCEED/.github/workflows/c-fortran-test-style.yml (revision ca94c3ddc8f82b7d93a79f9e4812e99b8be840ff)
1name: Style
2
3on:
4  push:
5    branches:
6      - main
7  pull_request:
8
9jobs:
10  test:
11    strategy:
12      matrix:
13        os: [ubuntu-22.04]
14        compiler: [clang]
15
16    runs-on: ${{ matrix.os }}
17
18    steps:
19    - name: Environment setup
20      uses: actions/checkout@v3
21    - name: Install clang-format
22      run: |
23          wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
24          sudo add-apt-repository 'deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-16 main'
25          sudo apt update && sudo apt install clang-format-16
26    - name: C style
27      env:
28        CC: ${{ matrix.compiler }}
29        FC: gfortran-11
30      run: |
31        make info
32        make format-c -j2 CLANG_FORMAT=clang-format-16 && git diff --exit-code
33