Add imports. #118
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: Code Quality | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
PY_COLORS: 1 | |
POETRY_HOME: /opt/poetry | |
jobs: | |
lint: | |
name: Lint and format code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Cache Poetry | |
uses: actions/cache@v3 | |
with: | |
path: $POETRY_HOME | |
key: poetry-1.2.0 | |
- name: Install Poetry | |
run: | | |
python3 -m venv $POETRY_HOME | |
$POETRY_HOME/bin/pip install poetry==1.2.0 | |
$POETRY_HOME/bin/poetry --version | |
echo "$POETRY_HOME/bin" >> $GITHUB_PATH | |
- name: Cache Dependencies | |
id: cache-deps | |
uses: actions/cache@v3 | |
with: | |
path: ~/.virtualenvs | |
key: poetry-${{ hashFiles('**/poetry.lock') }} | |
- name: Install Dependencies | |
run: poetry install --no-interaction --no-root --only dev | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Run pre-commit | |
run: poetry run pre-commit run -a --verbose --show-diff-on-failure |