Skip to content

Commit 4faa955

Browse files
authored
QPID-8610: add .github/workflows/codeql.yml GitHub Actions workflow (#37)
1 parent 33adb67 commit 4faa955

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
name: "CodeQL"
8+
9+
on:
10+
push:
11+
branches: [ "main" ]
12+
pull_request:
13+
# The branches below must be a subset of the branches above
14+
branches: [ "main" ]
15+
schedule:
16+
- cron: '39 8 * * 0'
17+
18+
jobs:
19+
analyze:
20+
name: Analyze
21+
runs-on: ubuntu-latest
22+
permissions:
23+
actions: read
24+
contents: read
25+
security-events: write
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
language: ['cpp', 'python', 'ruby' ] # leaving out 'csharp' binding as we currently don't build it in CI
31+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
32+
# Use only 'java' to analyze code written in Java, Kotlin or both
33+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
34+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
35+
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v3
39+
40+
# Initializes the CodeQL tools for scanning.
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@v2
43+
with:
44+
languages: ${{ matrix.language }}
45+
# If you wish to specify custom queries, you can do so here or in a config file.
46+
# By default, queries listed here will override any specified in a config file.
47+
# Prefix the list here with "+" to use these queries and those in the config file.
48+
49+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
50+
# queries: security-extended,security-and-quality
51+
52+
# not installing proton packages since they are not available in the qpid ppa for ubuntu jammy yet
53+
- name: Install dependencies (cpp)
54+
if: matrix.language == 'cpp'
55+
run: |
56+
sudo apt-get -yq --no-install-suggests --no-install-recommends install \
57+
libboost-dev libboost-program-options-dev libboost-system-dev libboost-test-dev \
58+
libxqilla-dev libxerces-c-dev \
59+
libibverbs-dev librdmacm-dev \
60+
libdb++-dev libaio-dev \
61+
swig python2-dev ruby-dev \
62+
uuid-dev libnss3-dev libnss3-tools libsasl2-dev sasl2-bin
63+
64+
curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
65+
python2 get-pip.py
66+
67+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
68+
# If this step fails, then you should remove it and run the build manually (see below)
69+
- name: Autobuild
70+
if: matrix.language == 'cpp'
71+
uses: github/codeql-action/autobuild@v2
72+
# https://github.com/github/codeql/discussions/11260
73+
env:
74+
MAKEFLAGS: -j2
75+
76+
# ℹ️ Command-line programs to run using the OS shell.
77+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
78+
79+
# If the Autobuild fails above, remove it and uncomment the following three lines.
80+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
81+
82+
# - run: |
83+
# echo "Run, Build Application using script"
84+
# ./location_of_script_within_repo/buildscript.sh
85+
86+
- name: Perform CodeQL Analysis
87+
uses: github/codeql-action/analyze@v2
88+
with:
89+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)