Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-tests.yml: implement docker layer caching #996

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,26 @@ jobs:
# Needed by Codecov
fetch-depth: 2

- name: Prepare database services
# We do this before caching for two reasons:
# 1. Avoid caching pull-only images (docker pull is faster)
# 2. Gives the mysql service time to spin up to avoid delays
run: |
docker-compose --env-file test/env up -d mysql-integration-test
docker-compose --env-file test/env pull flyway-integration-test

- name: Docker layer caching
# In the post-run, the cache is created without any images that
# exist at this point. Then the cache is restored if it exists.
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
composer run test
docker-compose --env-file test/env build smr-integration-test
docker-compose --env-file test/env run --rm flyway-integration-test
docker-compose --env-file test/env run --rm smr-integration-test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down