Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quick fix #70

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/test-python-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ on:
type: boolean
required: true
default: true
pyproject-toml:
description: "The path to the pyproject.toml file."
pyproject-toml-directory:
description: "The directory where pyproject.toml is located."
type: string
required: true
default: "pyproject.toml"
default: "."

jobs:
test-py-code:
runs-on: ubuntu-latest
env:
PYPROJECT_TOML: ${{ inputs.pyproject-toml-directory }}/pyproject.toml
steps:
- name: 🐍 Set up Python ${{ inputs.python-version }} Environment
uses: ocadotechnology/codeforlife-workspace/.github/actions/python/setup-environment@main
Expand All @@ -42,19 +44,19 @@ jobs:

- name: 🔎 Check Import Sort
working-directory: ${{ inputs.working-directory }}
run: pipenv run isort --settings-file=${{ inputs.pyproject-toml }} --check ${{ inputs.source-path }}
run: pipenv run isort --settings-file=${{ env.PYPROJECT_TOML }} --check ${{ inputs.source-path }}

- name: 🔎 Check Code Format
working-directory: ${{ inputs.working-directory }}
run: if ! pipenv run black --config=${{ inputs.pyproject-toml }} --check ${{ inputs.source-path }}; then exit 1; fi
run: if ! pipenv run black --config=${{ env.PYPROJECT_TOML }} --check ${{ inputs.source-path }}; then exit 1; fi

- name: 🔎 Check Static Type Hints
working-directory: ${{ inputs.working-directory }}
run: pipenv run mypy --config-file=${{ inputs.pyproject-toml }} ${{ inputs.source-path }}
run: pipenv run mypy --config-file=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}

- name: 🔎 Check Static Code
working-directory: ${{ inputs.working-directory }}
run: pipenv run pylint --rcfile=${{ inputs.pyproject-toml }} ${{ inputs.source-path }}
run: pipenv run pylint --rcfile=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}

- name: 🔎 Check Django Migrations
if: inputs.check-django-migrations
Expand All @@ -63,6 +65,6 @@ jobs:

- name: 🧪 Test Code Units
working-directory: ${{ inputs.working-directory }}
run: pipenv run pytest -n=auto -c=${{ inputs.pyproject-toml }} ${{ inputs.source-path }}
run: pipenv run pytest -n=auto -c=${{ env.PYPROJECT_TOML }} ${{ inputs.source-path }}

# TODO: assert code coverage target.