Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

---
# https://docs.github.com/en/actions/guides/building-and-testing-python
name: Base Lint
on:
push:
branches:
- main
- master
pull_request:
jobs:
base:
#runs-on: ubuntu-latest
runs-on: ubuntu-20.04
# Note with this version testing you do not need tox in the cloud
strategy:
matrix:
# 3.7 will not run with the current requirements.txt pinning
# we do not need matrix that is in python version
python-version: [ 3.9 ]
steps:
# checkout repo under $GITHUB_WORKSPACE
- name: Checkout action
uses: actions/checkout@v2
with:
lfs: true
#submodules should be tested one at a time
#submodules: recursive
# install latest python version
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Cache pip
uses: actions/cache@v2
with:
# Ubuntu specific path
path: ~/.cache/pip
# https://github.com/actions/cache/blob/main/examples.md#python---pip
# See if there is a cache hit looking for the requirements.txt
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
if [ -f python/requirements.txt ]; then pip install -r python/requirements.txt; fi
# https://snapcraft.io/install/shfmt/ubuntu
- name: Install ubuntu dependencies for shfmt and mdl
run: |
sudo apt update
sudo apt install snapd
sudo snap install shfmt mdl
# Not needed there is a snap package
# install dependencies for ruby gem mdl
# https://github.com/ruby/setup-ruby
#- name: Install ruby
#uses: ruby/setup-ruby@v1
#with:
#ruby-version: 3.0
#- name: Install Gems
#run: |
#gem install mdl
# install dependencies for markdownlint-cli
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
# https://github.com/pre-commit/action
- name: Run Pre-commit
uses: pre-commit/[email protected]
# No longer needed in pre-commit so edit .pre-commit-config.yaml
# and you do not need to duplicate all these actions
#- name: Lint with flake8
#run: |
#pip install flake8
#flake8 --exclude ./model ./python
# No longer needed in pre-commit
#- name: Lint with mypy
#run: |
#pip install mypy
#mypy --namespace-packages $(find . -name "*.py")
# No longer needed in pre-commit
#- name: Lint with bandit
#run: |
#pip install bandit
#bandit $(find . -type d \( -path "./.env" -o -path "./lambda_stage" \) -prune -false \
#-o -name "*.py" -a -not -name "test_*")
# No longer needed in pre-commit
#- name: Lint with pydocstyle
#run: |
#pip install pydocstyle
#pydocstyle --convention=google $(find . -name "*.py")
# No longer needed in pre-commit
#- name: Reformat with black
#uses: psf/black@stable
# A custom action https://github.com/marketplace/actions/yaml-lint
# Causes some strange file to get linted
#- name: Lint with yamllint action
#uses: ibiqlik/[email protected]
#with:
#file_or_dir: .
# you need all config files valid for this to work
#- name: Lint with yamllint
#run: |
#pip install yamllint
#yamllint $(find . -name "*.yaml" -o -name "*.yml")
#echo running yamllint
#yamllint .