Files
lammps/.github/workflows/codeql-python.yml

43 lines
1.3 KiB
YAML

# 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