-
Notifications
You must be signed in to change notification settings - Fork 10
82 lines (65 loc) · 2.69 KB
/
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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Formatting
on:
workflow_dispatch:
push:
branches: [develop]
pull_request:
jobs:
clang-format:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -qq clang-format colordiff
- name: Run clang-format
run: |
before="${{ github.event.pull_request.base.sha }}"
if [ "$before" == "" ]; then
before="${{ github.event.before }}"
fi
diff=$(git-clang-format --diff --commit "$before")
[ "$diff" = "no modified files to format" ] && exit 0
[ "$diff" = "clang-format did not modify any files" ] && exit 0
printf "\033[1mYou have introduced coding style breakages, suggested changes:\n\n"
echo "$diff" | colordiff
exit 1
cmake-format:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -qq cmake-format
- name: Run cmake-format
run: |
cmake-format --check $(find ${{github.workspace}} -name CMakeLists.txt)
code=$?
if [[ $code != 0 ]]; then
exit 1
fi
exit 0
clang-tidy:
if: false # skip job until it's properly setup to be runnable locally
runs-on: [ubuntu-24.04] # Change to ubuntu-latest when that changes over
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -qq gnuradio-dev python3-packaging libusb-1.0-0-dev libwxgtk3.2-dev libsoapysdr-dev clang-tidy
- name: Run clang-tidy (everything but GTest tests)
run: |
cmake -B build -S . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
for file in $(find plugins/gr-limesdr/python/bindings -name "*.cc"); do echo "" > "$file"; done # Fail due to missing headers which get generated when compiling; replacing instead of deleting because missing files error out
run-clang-tidy -warnings-as-errors '*' -p build/ -j $(nproc)
- name: Run clang-tidy (only library and GTest tests)
run: |
cmake -B build -S . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=0 -DENABLE_HEADERS=0 -DENABLE_USB_FTDI=0 -DENABLE_USB_FX3=0 -DENABLE_LITE_PCIE=0 -DENABLE_CLI=0 -DENABLE_GUI=0 -DENABLE_AMARISOFT_PLUGIN=0 -DENABLE_SOAPYSDR=0 -DENABLE_EXAMPLES=0 -DENABLE_UDEV_RULES=0
run-clang-tidy -warnings-as-errors '*' -p build/ -j $(nproc)