feature(packge): Additional mypy and ruff configuration #3
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
# SPDX-License-Identifier: MIT | ||
# SPDX-FileCopyrightText: 2024 Helio Chissini de Castro | ||
name: Commit Validation | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths-ignore: | ||
- '**.rst' | ||
push: | ||
jobs: | ||
build: | ||
name: Commit Validation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: webiny/[email protected] | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: 'poetry' | ||
- run: | ||
poetry install -q | ||
- name: MyPy static check source | ||
id: mypy | ||
run: | | ||
poetry run mypy --config-file pyproject.toml --pretty ./src >> $GITHUB_STEP_SUMMARY | ||
continue-on-error: true | ||
- name: MyPy static check tests | ||
id: mypy | ||
Check failure on line 39 in .github/workflows/commit_checks.yaml GitHub Actions / Commit ValidationInvalid workflow file
|
||
run: | | ||
poetry run mypy --config-file pyproject.toml --pretty ./tests >> $GITHUB_STEP_SUMMARY | ||
continue-on-error: true | ||
- name: Ruff Linting | ||
id: ruff | ||
run: | | ||
poetry install | ||
poetry run ruff check --config pyproject.toml --output-format github . | ||
continue-on-error: true | ||
- run: | | ||
if [ ${{ steps.mypy.outcome }} != 'success' ] || [ ${{ steps.ruff.outcome }} != 'success' ]; then | ||
echo "One or more checks failed" | ||
exit 1 | ||
fi | ||