Fix issue #504: Run lint and tests for generated projects #2
Workflow file for this run
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 Generated Project | |
on: [push, pull_request] | |
jobs: | |
test-generated: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
pipx install poetry | |
poetry install | |
- name: Generate project | |
run: | | |
poetry run cookiecutter . --no-input \ | |
project_name="Test Project" \ | |
project_slug="test_project" \ | |
description="Test project for CI" \ | |
author_name="OpenHands" \ | |
author_email="[email protected]" \ | |
python_version="3.11" \ | |
api="Django Ninja" \ | |
html="HTMX" \ | |
use_sentry="y" | |
- name: Install generated project dependencies | |
working-directory: ./test_project | |
run: | | |
poetry install | |
- name: Run linting | |
working-directory: ./test_project | |
run: | | |
# Skip pre-commit hooks that check template files | |
poetry run ruff check . | |
poetry run black . --check | |
- name: Run tests | |
working-directory: ./test_project | |
run: | | |
poetry run pytest |