Implement test_queue_orders_breached_then_due_soon_then_priority_then… #67
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
| # path: .github/workflows/ci.yml | |
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_DB: policylens | |
| POSTGRES_USER: policylens | |
| POSTGRES_PASSWORD: policylens | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U policylens -d policylens" | |
| --health-interval=5s | |
| --health-timeout=3s | |
| --health-retries=20 | |
| env: | |
| DJANGO_DEBUG: "0" | |
| DJANGO_SECRET_KEY: "ci-secret-key" | |
| DJANGO_ALLOWED_HOSTS: "localhost,127.0.0.1" | |
| DATABASE_URL: "postgresql://policylens:policylens@localhost:5432/policylens" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements-dev.txt | |
| - name: Format check (black) | |
| run: | | |
| python -m black . --check | |
| - name: Lint (ruff) | |
| run: | | |
| python -m ruff check . | |
| - name: Migrate | |
| run: | | |
| python manage.py migrate --noinput | |
| - name: Run tests | |
| run: | | |
| pytest -q --cov=policylens --cov-report=term-missing --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |