From caa754037b849c1cdf224ff76cb44f7243f7bdf5 Mon Sep 17 00:00:00 2001 From: LGTM Migrator Date: Thu, 8 Dec 2022 17:10:50 +0000 Subject: [PATCH] Add CodeQL workflow for GitHub code scanning --- .github/workflows/codeql.yml | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..7e12d34 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,70 @@ +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: "12 7 * * 0" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ python, cpp ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Packages (cpp) + if: ${{ matrix.language == 'cpp' }} + run: | + sudo apt-get update + sudo apt-get install --yes python3-pip + + - name: Configure (cpp) + if: ${{ matrix.language == 'cpp' }} + run: python3 cmakegen.py + + - name: After Prepare (cpp) + if: ${{ matrix.language == 'cpp' }} + run: | + pip3 install wheel cmake conan + export PATH=~/.local/bin:$PATH && echo "PATH=$PATH" >> $GITHUB_ENV + cmake --version + conan --version + conan profile new default --detect + conan profile update settings.compiler.version=9 default + conan profile update settings.compiler.libcxx=libstdc++11 default + conan remote update conancenter https://center.conan.io False + + - 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 + if: ${{ matrix.language == 'python' }} + + - name: Build cpp + if: ${{ matrix.language == 'cpp' }} + run: | + cd build + cmake --build . --config Debug + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}"