-
Notifications
You must be signed in to change notification settings - Fork 129
47 lines (38 loc) · 1.15 KB
/
check-clang-format.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Checks - clang-format
on:
push:
pull_request:
workflow_dispatch:
jobs:
clang_format_check:
runs-on: ubuntu-latest
container:
image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack
steps:
- name: Install git
run: |
apt update
apt install -y git
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
- name: Add safe directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Print clang-format version
run: clang-format --version
- name: Run checker on code
run: |
./scripts/format.sh benchmarks examples include src test
- name: Run git diff to see if anything changed
run: /usr/bin/git diff --name-only --exit-code
- name: Run git diff if we failed
if: failure()
run: /usr/bin/git diff > diff
- name: Archive diff if we failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: diff
path: |
${{ github.workspace }}/diff