From 240b8805dd9082e9398a1daae4e88374e4be4620 Mon Sep 17 00:00:00 2001 From: Paul Wulff <121822604+mtmpaulwulff@users.noreply.github.com> Date: Thu, 15 Feb 2024 22:40:47 +0100 Subject: [PATCH] Update ci.yml to only build images relevant for running pytest In order to run pytest we can constrain the build command to only build the images related to the django service. This mainly prevents the docs image from being built unnecessarily. This cuts run time of the Github Actions workflow from approx. 4min 30s to below 3min. --- {{cookiecutter.project_slug}}/.github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index e39933fe1..414ee1e60 100644 --- a/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Run pre-commit uses: pre-commit/action@v3.0.0 - # With no caching at all the entire ci process takes 4m 30s to complete! + # With no caching at all the entire ci process takes 3m to complete! pytest: runs-on: ubuntu-latest {%- if cookiecutter.use_docker == 'n' %} @@ -69,7 +69,7 @@ jobs: {%- if cookiecutter.use_docker == 'y' %} - name: Build the Stack - run: docker compose -f local.yml build + run: docker compose -f local.yml build django - name: Run DB Migrations run: docker compose -f local.yml run --rm django python manage.py migrate