Skip to content

Commit bf505c5

Browse files
authored
Add codeql workflow (#45)
1 parent 4aa4fd5 commit bf505c5

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
analyze:
11+
name: Analyze (C/C++)
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [ 'cpp' ]
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v4
30+
with:
31+
languages: ${{ matrix.language }}
32+
queries: +security-and-quality
33+
34+
- name: Install dependencies
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y \
38+
build-essential \
39+
autoconf \
40+
automake \
41+
autopoint \
42+
libtool \
43+
pkg-config \
44+
git \
45+
libjpeg-dev \
46+
libpng-dev \
47+
zlib1g-dev \
48+
libcupsfilters-dev \
49+
libavahi-client-dev \
50+
libcups2-dev \
51+
libppd-dev \
52+
53+
- name: Install PAPPL and Build project
54+
run: |
55+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig
56+
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
57+
58+
# Install PAPPL
59+
git clone --branch v1.4.10 https://github.com/michaelrsweet/pappl.git
60+
cd pappl
61+
./configure --enable-shared
62+
make -j$(nproc)
63+
sudo -E make install
64+
sudo ldconfig
65+
cd ..
66+
67+
# Verify PAPPL
68+
pkg-config --modversion pappl
69+
70+
# Build project
71+
./autogen.sh || true
72+
./configure
73+
make -j$(nproc)
74+
75+
- name: Perform CodeQL Analysis
76+
uses: github/codeql-action/analyze@v4
77+
with:
78+
category: "/language:${{ matrix.language }}"
79+

0 commit comments

Comments
 (0)