Skip to content

Merge pull request #126 from scott-wilson/dependabot/pip/bindings/pyt… #162

Merge pull request #126 from scott-wilson/dependabot/pip/bindings/pyt…

Merge pull request #126 from scott-wilson/dependabot/pip/bindings/pyt… #162

Workflow file for this run

# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: ["main"]
paths:
- .github/workflows/codeql_python.yml
- bindings/python/pychecks/**
- bindings/python/tests/**
- bindings/python/conftest.py
- bindings/python/poetry.lock
- bindings/python/pyproject.toml
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
paths:
- .github/workflows/codeql_python.yml
- bindings/python/pychecks/**
- bindings/python/tests/**
- bindings/python/conftest.py
- bindings/python/poetry.lock
- bindings/python/pyproject.toml
schedule:
- cron: "0 0 * * 1"
jobs:
analyze:
name: Analyze Python
defaults:
run:
working-directory: bindings/python
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3" # Latest version
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python
# Build Python Project
- name: Setup Python ${{matrix.python-version}}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
- name: Python - Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ (matrix.python-version == '3.7') && '1.5.1' || 'latest' }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Python - Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Python - Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Python - Install project
run: poetry install --no-interaction
# Run the analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:python"