From 0be1a419c7538251db35f05bdb4567c1470885b5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 1 Oct 2020 12:52:23 -0400 Subject: [PATCH] split codeql workflow into two files as no compilation is needed for python --- .../{codeql-analysis.yml => codeql-cpp.yml} | 2 +- .github/workflows/codeql-python.yml | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) rename .github/workflows/{codeql-analysis.yml => codeql-cpp.yml} (97%) create mode 100644 .github/workflows/codeql-python.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-cpp.yml similarity index 97% rename from .github/workflows/codeql-analysis.yml rename to .github/workflows/codeql-cpp.yml index e84483ff6c..dcaab19d29 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-cpp.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['cpp', 'python'] + language: ['cpp'] steps: - name: Checkout repository diff --git a/.github/workflows/codeql-python.yml b/.github/workflows/codeql-python.yml new file mode 100644 index 0000000000..2d4a4992ed --- /dev/null +++ b/.github/workflows/codeql-python.yml @@ -0,0 +1,42 @@ +# GitHub action to run static code analysis on C++ and Python code +name: "CodeQL Code Analysis" + +on: + push: + branches: [master] + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['python'] + + steps: + - name: Checkout repository + if: ${{ github.repository == 'lammps/lammps' }} + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.repository == 'lammps/lammps' && github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + if: ${{ github.repository == 'lammps/lammps' }} + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + if: ${{ github.repository == 'lammps/lammps' }} + uses: github/codeql-action/analyze@v1