forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (103 loc) · 3.99 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Code Checks
on: [push, pull_request]
jobs:
cppcheck_1604:
runs-on: ubuntu-16.04
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt update
sudo apt install -y cppcheck libsqlite3-dev ccache sqlite3
- name: Cache PROJ build
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}-cache-cppcheck-1604
- name: Build PROJ
run: |
curl http://download.osgeo.org/proj/proj-6.3.2.tar.gz > proj-6.3.2.tar.gz
tar xzf proj-6.3.2.tar.gz
mv proj-6.3.2 proj
cd proj
CC="ccache gcc" CXX="ccache g++" CFLAGS=-O0 CXXFLAGS=-O0 ./configure --without-static --prefix=/tmp/projinstall
make -j$(nproc)
make install -j$(nproc)
- name: Run configure
run: (cd gdal && ./configure --with-proj=/tmp/projinstall)
- name: Run cppcheck test
run: ./gdal/scripts/cppcheck.sh
cppcheck_1804:
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt update
sudo apt install -y cppcheck libsqlite3-dev ccache sqlite3
- name: Cache PROJ build
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}-cache-cppcheck-1804
- name: Build PROJ
run: |
curl http://download.osgeo.org/proj/proj-6.3.2.tar.gz > proj-6.3.2.tar.gz
tar xzf proj-6.3.2.tar.gz
mv proj-6.3.2 proj
cd proj
CC="ccache gcc" CXX="ccache g++" CFLAGS=-O0 CXXFLAGS=-O0 ./configure --without-static --prefix=/tmp/projinstall
make -j$(nproc)
make install -j$(nproc)
- name: Run configure
run: (cd gdal && ./configure --with-proj=/tmp/projinstall)
- name: Run cppcheck test
run: ./gdal/scripts/cppcheck.sh
code_quality_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Detect tabulations
run: ./gdal/scripts/detect_tabulations.sh
- name: Detect printf
run: ./gdal/scripts/detect_printf.sh
- name: Detect self assigments
run: ./gdal/scripts/detect_self_assignment.sh
- name: Detect suspicous char digit zero
run: ./gdal/scripts/detect_suspicious_char_digit_zero.sh
- name: Shellcheck
run: shellcheck -e SC2086,SC2046 $(find gdal -name '*.sh' -a -not -name ltmain.sh)
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt install python3-pip
sudo pip3 install flake8
- name: Run flake8
run: |
# flake8 codes to just emulate pyflakes (http://flake8.pycqa.org/en/latest/user/error-codes.html)
export FLAKE8="flake8 --select=F401,F402,F403,F404,F405,F406,F407,F601,F602,F621,F622,F631,F701,F702,F703,F704,F705,F706,F707,F721,F722,F811,F812,F821,F822,F823,F831,F841,F901,E999"
$FLAKE8 autotest
$FLAKE8 gdal/swig/python/scripts
$FLAKE8 gdal/swig/python/samples
doxygen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt install doxygen texlive-latex-base
- name: Run doxygen
run: |
cd gdal/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