xref: /libCEED/.github/workflows/c-fortran-test-style.yml (revision f359f128d58d9b574c7d200aedc8457b301f7081)
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:
13d83cf49fSJeremy 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 -
246eb06d7cSJeremy L Thompson          sudo add-apt-repository 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main'
256eb06d7cSJeremy L Thompson          sudo apt update && sudo apt install clang-format-19
263446d1b5SJeremy L Thompson    - name: C style
273446d1b5SJeremy L Thompson      env:
283446d1b5SJeremy L Thompson        CC: ${{ matrix.compiler }}
29*ed1ebff7SJeremy L Thompson        FC: gfortran
303446d1b5SJeremy L Thompson      run: |
313446d1b5SJeremy L Thompson        make info
326eb06d7cSJeremy L Thompson        make format-c -j CLANG_FORMAT=clang-format-19 && git diff --exit-code
33