From 1fbc23b91b76529c9c8a523f50c2be67af005b28 Mon Sep 17 00:00:00 2001 From: LGTM Migrator Date: Tue, 6 Dec 2022 15:20:34 +0000 Subject: [PATCH] Add CodeQL workflow for GitHub code scanning --- .github/workflows/codeql.yml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 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 000000000..7c86216c7 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,60 @@ +name: "CodeQL" + +on: + push: + branches: [ "master", "develop" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: "25 20 * * 1" + +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 mpich libmpich-dev libhdf5-mpich-dev + + - name: After Prepare (cpp) + if: ${{ matrix.language == 'cpp' }} + run: export HDF5_ROOT_DIR=/usr/lib/x86_64-linux-gnu/hdf5/mpich/ && echo "HDF5_ROOT_DIR=$HDF5_ROOT_DIR" >> $GITHUB_ENV + + - name: Before Index (cpp) + if: ${{ matrix.language == 'cpp' }} + run: export HDF5_ROOT_DIR=/usr/lib/x86_64-linux-gnu/hdf5/mpich/ && echo "HDF5_ROOT_DIR=$HDF5_ROOT_DIR" >> $GITHUB_ENV + + - 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: make -j 2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}"