forked from cholla-hydro/cholla
-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (24 loc) · 1021 Bytes
/
code_formatting.yml
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
name: Code Formatting
on: [pull_request, push]
jobs:
cpp-format:
runs-on: ubuntu-latest
# Setup environment variables
env:
CLANG_FORMAT_VERSION: 17
steps:
- uses: actions/checkout@v3
- name: Install clang-format
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ env.CLANG_FORMAT_VERSION }} main"
sudo apt install clang-format-${{ env.CLANG_FORMAT_VERSION }}
sudo ln --symbolic --force /usr/bin/clang-format-${{ env.CLANG_FORMAT_VERSION }} /usr/bin/clang-format
- name: Verify clang-format installation
run: |
clang-format-${{ env.CLANG_FORMAT_VERSION }} --version
which clang-format-${{ env.CLANG_FORMAT_VERSION }}
clang-format --version
which clang-format
- name: Check if files are properly formatted
run: tools/clang-format_runner.sh --dry-run --Werror