-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (75 loc) · 2.67 KB
/
check.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
name: Checks
on:
pull_request:
jobs:
cppcheck:
name: Cppcheck
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: src/percona_pg_telemetry
- name: Checkout cppcheck sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: "danmar/cppcheck"
ref: "2.13.4"
path: src/cppcheck
- name: Build and install cppcheck
working-directory: src/cppcheck
run: |
mkdir build
cd build
cmake ..
cmake --build .
sudo cmake --install .
- name: Execute linter check with cppcheck
working-directory: src/percona_pg_telemetry
run: |
set -x
cppcheck --enable=all --inline-suppr --template='{file}:{line},{severity},{id},{message}' --error-exitcode=1 --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression:percona_pg_telemetry.c --check-config .
format:
name: Format
runs-on: ubuntu-22.04
steps:
- name: Clone postgres repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: 'postgres/postgres'
ref: 'REL_17_STABLE'
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: 'contrib/percona_pg_telemetry'
- name: Configure postgres
run: ./configure
- name: Install perltidy
run: sudo cpan -T SHANCOCK/Perl-Tidy-20230309.tar.gz
- name: Install pg_bsd_indent
working-directory: src/tools/pg_bsd_indent
run: sudo make install
- name: Add pg_bsd_indent and pgindent to path
run: |
echo "/usr/local/pgsql/bin" >> $GITHUB_PATH
echo "${{ github.workspace }}/src/tools/pgindent" >> $GITHUB_PATH
- name: Format sources
working-directory: contrib/percona_pg_telemetry
run: |
make update-typedefs
make indent
- name: Check files are formatted and no source code changes
working-directory: contrib/percona_pg_telemetry
run: |
git status
git diff --exit-code
license:
name: License
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check license headers
uses: apache/skywalking-eyes/header@cd7b195c51fd3d6ad52afceb760719ddc6b3ee91 # v0.6.0
with:
token: "" # Prevent comments