Skip to content

Commit 33e1986

Browse files
lgtm-migratorAndreasFuchsTPM
authored andcommitted
Add CodeQL workflow for GitHub code scanning
1 parent 826c103 commit 33e1986

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: "12 6 * * 6"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ cpp ]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Install Packages
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install --yes autoconf-archive libcurl4-openssl-dev libjson-c-dev libssl-dev acl
33+
34+
- name: After Prepare
35+
run: |
36+
cd "$RUNNER_TEMP"
37+
mkdir installdir
38+
wget https://github.com/tpm2-software/tpm2-tss/archive/master.tar.gz
39+
git clone https://github.com/tpm2-software/tpm2-tss.git
40+
cd tpm2-tss
41+
./bootstrap
42+
./configure --prefix="$RUNNER_TEMP/installdir/usr" --disable-doxygen-doc
43+
make install
44+
export PKG_CONFIG_PATH="$RUNNER_TEMP/installdir/usr/lib/pkgconfig:$PKG_CONFIG_PATH" && echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
45+
export LD_LIBRARY_PATH="$RUNNER_TEMP/installdir/usr/lib:$LD_LIBRARY_PATH" && echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
46+
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v2
49+
with:
50+
languages: ${{ matrix.language }}
51+
queries: +security-and-quality
52+
53+
- name: Autobuild
54+
uses: github/codeql-action/autobuild@v2
55+
56+
- name: Perform CodeQL Analysis
57+
uses: github/codeql-action/analyze@v2
58+
with:
59+
category: "/language:${{ matrix.language }}"

0 commit comments

Comments
 (0)