From 8621dd4777bd2868681caf7dd24fe54803a0405f Mon Sep 17 00:00:00 2001 From: Dan Hemberger Date: Tue, 16 Feb 2021 22:13:16 -0800 Subject: [PATCH] run-tests.yml: implement docker layer caching This GitHub Action caches all layers that are created after the step where it is specified (which is why we pre-fetch some pull-only images that we know we'll be using to run the tests). The goal is faster CI by speeding up the build stage. --- .github/workflows/run-tests.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index bbd7436fb..0464a3bf3 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,6 +15,19 @@ jobs: # Needed by Codecov fetch-depth: 2 + # Pull the latest image to build, and avoid caching pull-only images. + # (docker pull is faster than caching in most cases.) + - name: Download pull-only images + run: docker-compose pull mysql-integration-test flyway-integration-test + + # In this step, this action saves a list of existing images, + # the cache is created without them in the post run. + # It also restores the cache if it exists. + - name: Docker layer caching + uses: satackey/action-docker-layer-caching@v0.0.11 + # Ignore the failure of a step and avoid terminating the job. + continue-on-error: true + - name: Run tests run: | composer run start:integration-services