Python Lint Workflow #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Lint Workflow | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: ["main"] | |
schedule: | |
- cron: "22 3 * * 2" | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
linter: | |
[ | |
"flake8", | |
"pylint", | |
"ruff", | |
"mypy", | |
"pytype", | |
"pyright", | |
"fixit", | |
"pyre", | |
] | |
python-version: ["3.11"] | |
os: [ubuntu-latest] # doesn't yet work on Windows | |
fail-fast: false | |
steps: | |
# install dependencies for all linters, then run the linter, so we don't get import failures when the linters scan the code | |
# upgrade pip, so that we can install flake8_sarif_formatter properly from the git repo | |
- uses: actions/checkout@v4 | |
- name: Install pip dependencies | |
run: | | |
python3 -mpip install -r requirements.txt | |
- name: Run Python Lint | |
uses: advanced-security/python-lint-code-scanning-action@v1 | |
with: | |
linter: ${{ matrix.linter }} | |
python-version: ${{ matrix.python-version }} |