Skip to content

Commit

Permalink
run-tests.yml: implement docker layer caching
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hemberger committed Feb 17, 2021
1 parent 955f0af commit 05fe1d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Run tests
run: |
composer run start:integration-services
Expand Down

0 comments on commit 05fe1d0

Please sign in to comment.