🧹 refactor: remove redundant package import in run_ruff.py file #13
This file contains hidden or 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: CI Pipeline | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-test-lint: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_DB: taskflow | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| rabbitmq: | |
| image: rabbitmq:3.12-management | |
| ports: | |
| - 5672:5672 | |
| - 15672:15672 | |
| env: | |
| DEBUG: False | |
| SECRET_KEY: dummy-key | |
| DJANGO_ALLOWED_HOSTS: localhost | |
| POSTGRES_DB: taskflow | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| CELERY_BROKER_URL: amqp://guest:guest@localhost:5672// | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m venv venv | |
| source venv/bin/activate | |
| pip install -r requirements.txt | |
| - name: Run migrations | |
| run: | | |
| source venv/bin/activate | |
| python manage.py migrate | |
| - name: Run tests with coverage | |
| run: | | |
| source venv/bin/activate | |
| pytest --cov=. --cov-report=html | |
| - name: Run Ruff Linter | |
| run: | | |
| source venv/bin/activate | |
| ruff check . | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: htmlcov | |
| path: htmlcov/ | |
| deploy-coverage: | |
| needs: build-test-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download coverage artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: htmlcov | |
| path: htmlcov | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./htmlcov | |
| publish_branch: gh-pages |