Fix RTD build: use uv pip install instead of sync #2174
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Just for running commands | |
| run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| - name: Setup Python 3.12 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Node requirements | |
| run: npm ci | |
| - name: Install Python requirements | |
| run: | | |
| pip install --upgrade uv | |
| uv sync --frozen | |
| - name: Run linting | |
| run: | | |
| PATH=$(pwd)/.venv/bin/:${PATH} just lint | |
| env: | |
| SECRET_KEY: secret-key-for-testing-only | |
| DEBUG: on | |
| PYTHON_CMD_PREFIX_WITH_DEPS: "" | |
| PYTHON_CMD_PREFIX: "" | |
| NODE_CMD_PREFIX: "" | |
| test: | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| runs-on: ubuntu-latest | |
| name: Tests install script | |
| env: | |
| BUILD_DIR: /home/runner/work/django-base-site/new_project/ | |
| SECRET_KEY: secret-key-for-testing-only | |
| READ_DOT_ENV_FILE: on | |
| PYTHON_CMD_PREFIX: docker compose run -u root --rm --no-deps web | |
| DOCKER_COMPOSE_PREFIX: docker compose run -u root -e DATABASE_URL -e READ_DOT_ENV_FILE -e SECRET_KEY -e DB_SSL_REQUIRED --rm --no-deps web | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Just for running commands | |
| run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Test install script | |
| run: | | |
| ./scripts/start_new_project "example" ${GITHUB_REF#refs/heads/} 1 ${{ env.BUILD_DIR }} | |
| - name: Verify project files were updated correctly | |
| working-directory: ${{ env.BUILD_DIR }} | |
| run: | | |
| echo "Verifying compose.yml was updated..." | |
| grep -q "image: example" compose.yml || (echo "ERROR: compose.yml not updated correctly" && exit 1) | |
| ! grep -q "image: epicserve/django-base-site" compose.yml || (echo "ERROR: compose.yml still contains template text" && exit 1) | |
| echo "Verifying justfile was updated..." | |
| grep -q "example" justfile || (echo "ERROR: justfile not updated correctly" && exit 1) | |
| echo "Verifying Dockerfile.web was updated..." | |
| grep -q "example" config/docker/Dockerfile.web || (echo "ERROR: Dockerfile.web not updated correctly" && exit 1) | |
| echo "All verification checks passed!" | |
| - name: Build docker images | |
| working-directory: ${{ env.BUILD_DIR }} | |
| run: docker compose build web node | |
| - name: Build assets | |
| working-directory: ${{ env.BUILD_DIR }} | |
| run: just build_frontend | |
| - name: Run tests | |
| working-directory: ${{ env.BUILD_DIR }} | |
| run: ${{ env.DOCKER_COMPOSE_PREFIX }} pytest --cov --ds=config.settings.test_runner | |
| env: | |
| DATABASE_URL: postgres://postgres:postgres@172.17.0.1:5432/postgres | |
| READ_DOT_ENV_FILE: False | |
| DB_SSL_REQUIRED: False |