forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (86 loc) · 2.73 KB
/
code_checks.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Code Checks
on:
push:
paths-ignore:
- 'doc/**'
branches-ignore:
- 'backport**'
pull_request:
paths-ignore:
- 'doc/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
cppcheck_2004:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Requirements
run: |
sudo apt update
sudo apt install -y cppcheck libsqlite3-dev ccache sqlite3 libproj-dev cmake
- name: Run cmake
run: |
mkdir build
cd build
cmake ..
- name: Run cppcheck test
run: |
cd build
../scripts/cppcheck.sh
code_quality_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect tabulations
run: ./scripts/detect_tabulations.sh
- name: Detect printf
run: ./scripts/detect_printf.sh
- name: Detect self assignments
run: ./scripts/detect_self_assignment.sh
- name: Detect suspicious char digit zero
run: ./scripts/detect_suspicious_char_digit_zero.sh
- name: Detect missing includes
run: ./scripts/detect_missing_include.sh
- name: Shellcheck
run: shellcheck -e SC2086,SC2046,SC2164,SC2054 $(find . -name '*.sh' -a -not -name ltmain.sh -a -not -wholename "./autotest/*" -a -not -wholename "./.github/*")
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
doxygen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Requirements
run: |
sudo apt update
sudo apt install doxygen texlive-latex-base
- name: Run doxygen
run: |
cd doc
make .doxygen_up_to_date >log.txt 2>&1
if grep -i warning log.txt | grep -v -e russian -e brazilian; then echo "Doxygen warnings found" && cat log.txt && /bin/false; else echo "No Doxygen warnings found"; fi
other_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Requirements
run: |
sudo apt install python3-pip wget
sudo pip3 install cffconvert
- name: Validate citation file
run: |
cffconvert --validate
cffconvert -f bibtex
cffconvert -f apalike