# GitHub action to run static code analysis on C++ and Python code name: "CodeQL Code Analysis" on: push: branches: [master] jobs: analyze: name: Analyze if: ${{ github.repository == 'lammps/lammps' }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: language: ['cpp', 'python'] steps: - name: Checkout repository uses: actions/checkout@v2 with: fetch-depth: 2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build - name: Building LAMMPS via CMake if: ${{ matrix.language == 'cpp' }} shell: bash working-directory: ${{github.workspace}}/build run: | cmake -C $GITHUB_WORKSPACE/cmake/presets/most.cmake $GITHUB_WORKSPACE/cmake cmake --build . --parallel 2 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1