Skip to content

Commit

Permalink
Add CodeQL workflow for GitHub code scanning (#350)
Browse files Browse the repository at this point in the history
Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com>
  • Loading branch information
lgtm-com[bot] and lgtm-migrator committed Jun 15, 2023
1 parent 2c267f7 commit 1b28251
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "35 9 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript, python, cpp ]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: After Prepare (cpp)
if: ${{ matrix.language == 'cpp' }}
run: |
mkdir custom_cmake
wget --quiet -O - "https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C custom_cmake
export PATH=$(pwd)/custom_cmake/bin:${PATH} && echo "PATH=$PATH" >> $GITHUB_ENV
cd $GITHUB_WORKSPACE/
export CMAKE_INCLUDE_PATH=$GITHUB_WORKSPACE/include:${CMAKE_INCLUDE_PATH} && echo "CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH" >> $GITHUB_ENV
export CMAKE_LIBRARY_PATH=$GITHUB_WORKSPACE/lib:${CMAKE_LIBRARY_PATH} && echo "CMAKE_LIBRARY_PATH=$CMAKE_LIBRARY_PATH" >> $GITHUB_ENV
mkdir $GITHUB_WORKSPACE/_lgtm_build_dir
cd $GITHUB_WORKSPACE/_lgtm_build_dir
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"

0 comments on commit 1b28251

Please sign in to comment.