Skip to content

[pre-commit.ci] pre-commit autoupdate #962

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #962

Workflow file for this run

# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
---
name: Linters
on:
push:
branches:
- "**" # matches every branch
- "!gh-pages" # excludes gh-pages branch
pull_request:
branches:
- master
- 1.7
jobs:
run_flake8:
name: Run flake8 against code tree
runs-on: ubuntu-latest
steps:
- name: checkout code tree
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: "x64"
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding file
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-3.9
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-
${{ runner.os }}-pip-
- name: Note Python version/implementation
run: |
which python3
python3 -c 'import sys; print(sys.version)'
python3 -c 'import platform; print(platform.python_implementation())'
python3 -m pip cache dir
- name: Ensure pip/setuptools is up to date
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel setuptools
- name: Install dependencies
run: |
python3 -m pip install --upgrade pytest
python3 -m pip install -e . --user
python3 -m pip install -e .[develop] --user
- name: Ensure version.py exists
run: python3 setup.py bdist_wheel
- name: Run Flake8 Tests against the code tree
env:
PYTHONPATH: ${{ github.workspace }}/src
run: |
python3 -m flake8
run_pylint:
name: Run pylint against code tree
runs-on: ubuntu-latest
steps:
- name: checkout code tree
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: "x64"
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding file
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-3.9
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('setup.py') }}-
${{ runner.os }}-pip-
- name: Note Python version/implementation
run: |
which python3
python3 -c 'import sys; print(sys.version)'
python3 -c 'import platform; print(platform.python_implementation())'
python3 -m pip cache dir
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel setuptools
python3 -m pip install --upgrade pytest
python3 -m pip install -e . --user
python3 -m pip install -e .[develop] --user
- name: Ensure version.py exists
run: python3 setup.py bdist_wheel
- name: Run pylint against the code tree
env:
PYTHONPATH: ${{ github.workspace }}/src
run: |
pylint src/decisionengine/
license-check:
name: Run REUSE to check license compliance
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: fsfe/reuse-action@v1