Skip to content

adding macie classification job #426

adding macie classification job

adding macie classification job #426

Workflow file for this run

name: Static Checks (mypy, flake8, black, isort)
on:
pull_request:
branches:
- main
push:
jobs:
Linting:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: [3.9]
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python
id: setup-python
uses: actions/setup-python@v3
with:
python-version: 3.9
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Load Cached Poetry Installation
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-with-dev-0 # increment to reset cache
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-with-dev-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-with-dev-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# Activate virtual environment
#----------------------------------------------
- name: Activate Virtual Environment
run: source .venv/bin/activate
#----------------------------------------------
# Run MyPY check
#----------------------------------------------
- name: mypy check
run: poetry run mypy aws_sra_examples
#----------------------------------------------
# Run Flake8 check
#----------------------------------------------
- name: Flake8 Lint
run: poetry run flake8 aws_sra_examples
#----------------------------------------------
# Run Python Black check
#----------------------------------------------
- name: Black style check
run: poetry run black --check aws_sra_examples
#----------------------------------------------
# Run isort check
#----------------------------------------------
- name: Imports order check (isort)
run: poetry run isort --check aws_sra_examples