xref: /libCEED/.github/workflows/c-fortran-test-style.yml (revision d83cf49fece5d7d5441d5b92eb712b904329a4d2)
1dfb8ed23Sjeremyltname: Style
23446d1b5SJeremy L Thompson
33446d1b5SJeremy L Thompsonon:
43446d1b5SJeremy L Thompson  push:
5dcd9f19cSJeremy L Thompson    branches:
6dcd9f19cSJeremy L Thompson      - main
7dcd9f19cSJeremy L Thompson  pull_request:
83446d1b5SJeremy L Thompson
93446d1b5SJeremy L Thompsonjobs:
103446d1b5SJeremy L Thompson  test:
113446d1b5SJeremy L Thompson    strategy:
123446d1b5SJeremy L Thompson      matrix:
13*d83cf49fSJeremy L Thompson        os: [ubuntu-24.04]
143446d1b5SJeremy L Thompson        compiler: [clang]
153446d1b5SJeremy L Thompson
163446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
173446d1b5SJeremy L Thompson
183446d1b5SJeremy L Thompson    steps:
193446d1b5SJeremy L Thompson    - name: Environment setup
20e735508cSJeremy L Thompson      uses: actions/checkout@v4
212b730f8bSJeremy L Thompson    - name: Install clang-format
22e64bb3f3SSebastian Grimberg      run: |
23e64bb3f3SSebastian Grimberg          wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
240c9ac183SJeremy L Thompson          sudo add-apt-repository 'deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-17 main'
250c9ac183SJeremy L Thompson          sudo apt update && sudo apt install clang-format-17
263446d1b5SJeremy L Thompson    - name: C style
273446d1b5SJeremy L Thompson      env:
283446d1b5SJeremy L Thompson        CC: ${{ matrix.compiler }}
296c0547c1SJeremy L Thompson        FC: gfortran-11
303446d1b5SJeremy L Thompson      run: |
313446d1b5SJeremy L Thompson        make info
320c9ac183SJeremy L Thompson        make format-c -j2 CLANG_FORMAT=clang-format-17 && git diff --exit-code
33