Skip to content

Commit a78b49e

Browse files
committed
Added CodeQL workflow to GitHub Actions.
1 parent d780729 commit a78b49e

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# See https://codeql.github.com/ for details on CodeQL.
2+
#
3+
name: "CodeQL"
4+
5+
on:
6+
push:
7+
branches: [ "master" ]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: [ "master" ]
11+
schedule:
12+
- cron: '30 10 * * 2'
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
# Runner size impacts CodeQL analysis time. To learn more, please see:
18+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
19+
# - https://gh.io/supported-runners-and-hardware-resources
20+
# - https://gh.io/using-larger-runners
21+
# Consider using larger runners for possible analysis time improvements.
22+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
23+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
24+
permissions:
25+
actions: read
26+
contents: read
27+
security-events: write
28+
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
language: [ 'c-cpp' ]
33+
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
34+
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
35+
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
36+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v3
41+
42+
# Initializes the CodeQL tools for scanning.
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@v2
45+
with:
46+
languages: ${{ matrix.language }}
47+
# If you wish to specify custom queries, you can do so here or in a config file.
48+
# By default, queries listed here will override any specified in a config file.
49+
# Prefix the list here with "+" to use these queries and those in the config file.
50+
51+
# For more 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
52+
# queries: security-extended,security-and-quality
53+
54+
- name: Install dependencies
55+
run: sudo apt-get -o Acquire::Retries=3 -y install tzdata make apt-file software-properties-common libssl-dev build-essential autotools-dev autoconf automake pkgconf libboost-all-dev gperf libevent-dev uuid-dev sphinx-doc sphinx-common libhiredis-dev gcc g++
56+
57+
- name: Build gearmand
58+
- run: |
59+
./bootstrap.sh -a
60+
CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS"
61+
export CXXFLAGS
62+
./configure --enable-ssl
63+
gcc --version
64+
make
65+
66+
- name: Perform CodeQL Analysis
67+
uses: github/codeql-action/analyze@v2
68+
with:
69+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)