diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index b161e4a9..b6400090 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -16,6 +16,7 @@ jobs: runs-on: ubuntu-latest env: DOCKER_BUILDKIT: 1 + GIT_COMMIT: ${{ github.sha }} steps: - uses: actions/checkout@v2 @@ -25,10 +26,29 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set up environment run: ./scripts/bootstrap - - run: ./scripts/cibuild + - run: ./scripts/fetch-data + + - uses: docker/build-push-action@v5 + with: + context: src/django + push: false + tags: iow:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - run: | + docker compose up -d database django && + ./scripts/manage migrate && + ./scripts/manage collectstatic --no-input && + docker compose stop + + - run: ./scripts/test - run: ./scripts/cipublish if: | diff --git a/src/django/Dockerfile b/src/django/Dockerfile index d77ae42b..8a04db01 100644 --- a/src/django/Dockerfile +++ b/src/django/Dockerfile @@ -16,7 +16,8 @@ RUN set -ex \ postgresql-client \ " \ && apt-get update && apt-get install -y $buildDeps $deps --no-install-recommends \ - && pip install --no-cache-dir -r requirements.txt \ + && pip install uv \ + && VIRTUAL_ENV=$(python -c "import sys; print(sys.prefix)") uv pip install -r requirements.txt \ && apt-get purge -y --auto-remove $buildDeps \ $(! command -v gpg > /dev/null || echo 'gnupg dirmngr') \ && rm -rf requirements.txt /var/lib/apt/lists/*