Skip to content

Commit

Permalink
Use CI script to build for CodeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Aug 9, 2023
1 parent b1e5954 commit cc533ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Build Agent
uses: ./.github/actions/setup-build-agent
with:
target: static
cache-key: linux-gcc-x86_64-static

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand All @@ -36,10 +42,7 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.

- name: Configure Build
run: ./configure.py --cc=gcc --os=linux

- name: Build Library
run: make -j$(nproc)
run: ./src/scripts/ci_build.py codeql

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down
10 changes: 7 additions & 3 deletions src/scripts/ci_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def known_targets():
return [
'amalgamation',
'bsi',
'codeql',
'coverage',
'cross-android-arm32',
'cross-android-arm64',
Expand Down Expand Up @@ -169,6 +170,9 @@ def sanitize_kv(some_string):
flags += ['--with-doxygen', '--with-sphinx', '--with-rst2man']
test_cmd = None

if target == 'codeql':
test_cmd = None

if target == 'cross-win64':
# this test compiles under MinGW but fails when run under Wine
disabled_tests.append('certstor_system')
Expand Down Expand Up @@ -666,13 +670,13 @@ def main(args=None):

make_targets = ['libs', 'tests', 'cli']

if target in ['coverage', 'fuzzers']:
if target in ['coverage', 'fuzzers', 'codeql']:
make_targets += ['fuzzer_corpus_zip', 'fuzzers']

if target in ['examples']:
if target in ['examples', 'codeql']:
make_targets += ['examples']

if target in ['coverage', 'sanitizer'] and options.os not in ['windows']:
if target in ['coverage', 'sanitizer', 'codeql'] and options.os not in ['windows']:
make_targets += ['bogo_shim']

cmds.append(make_prefix + make_cmd + make_targets)
Expand Down

0 comments on commit cc533ac

Please sign in to comment.