Skip to content

Merge pull request #4346 from cjknight/lubricate_patch #159

Merge pull request #4346 from cjknight/lubricate_patch

Merge pull request #4346 from cjknight/lubricate_patch #159

# GitHub action to run static code analysis on C++ and Python code
name: "CodeQL Code Analysis"
on:
push:
branches: [develop]
workflow_dispatch:
jobs:
analyze:
name: Analyze
if: ${{ github.repository == 'lammps/lammps' }}
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
language: ['cpp', 'python']
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/${{ matrix.language }}.yml
- name: Create Build Environment
if: ${{ matrix.language == 'cpp' }}
run: mkdir build
- name: Building LAMMPS via CMake
if: ${{ matrix.language == 'cpp' }}
shell: bash
working-directory: build
run: |
cmake -C ../cmake/presets/most.cmake \
-D DOWNLOAD_POTENTIALS=off \
../cmake
cmake --build . --parallel 2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3