Run ruff on correct directory in GitHub Actions. #17
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: Test Cookiecutter | |
on: | |
pull_request: {} | |
push: | |
branches: master | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: ['3.11', '3.12'] | |
os: [ubuntu-latest] | |
name: Python ${{ matrix.os }} ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Python Poetry Action | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: 1.6 | |
- name: Install dependencies with poetry | |
run: poetry install | |
- run: poetry run ruff format hooks --check | |
- run: poetry run ruff check hooks | |
- run: poetry run mypy | |
- run: poetry run pytest --cov --cov-report=xml | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
- name: Configure git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Default Name" | |
git config --global init.defaultBranch master | |
- name: Run cookiecutter | |
run: poetry run cookiecutter . --no-input --config-file template_config.yml | |
- name: Run pre-commit | |
run: cd poetry_project && poetry install && poetry run pre-commit run --all-files |