forked from eth-cscs/DLA-Future
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 2.08 KB
/
check_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
# Distributed Linear Algebra with Future (DLAF)
#
# Copyright (c) 2018-2024, ETH Zurich
# All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#
name: Check format
on:
- push
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/javascript-action@v1
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends clang-format-15 fd-find python3 ripgrep
pip3 install black==23.03.0
pip3 install cmakelang==0.6.13
pushd /tmp
curl --output dasel \
--location https://github.com/TomWright/dasel/releases/download/v1.27.3/dasel_linux_amd64
sha256sum dasel
echo "1a5adbf8e5b69f48ad5d1665bf7ed056ea3ff8cf3312ce2dc7c3209939873489 dasel" | sha256sum --check
chmod +x dasel
mv dasel /usr/local/bin
popd
pushd /tmp
curl --output ripgrep.tar.gz \
--location https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep-13.0.0-x86_64-unknown-linux-musl.tar.gz
echo "ee4e0751ab108b6da4f47c52da187d5177dc371f0f512a7caaec5434e711c091 ripgrep.tar.gz" | sha256sum --check
tar --extract --strip-components 1 --file ripgrep.tar.gz
mv rg /usr/local/bin
popd
- name: Fetch master
run: git fetch --no-tags --depth=1 origin +refs/heads/master:refs/heads/master
- name: Check include guards
if: always()
run: |
find . test -type f '(' -name "*.h" -o -name "*.h.in" ')' \
| xargs -I{} sh -c \
"egrep -sq '^#pragma once' {} || echo {}" \
> pragma-once.check
for filepath in `cat pragma-once.check`; do \
echo "::error file=$filepath,line=1::missing include guard in $filepath"; \
done
test ! -s pragma-once.check