Skip to content

Commit

Permalink
Add docker layer cache tests
Browse files Browse the repository at this point in the history
Adding tests for docker layer caching
  • Loading branch information
velioglu committed Nov 18, 2024
1 parent f16c9ea commit 4295867
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/test_restore_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,20 @@ jobs:
run: |
echo "Cache didn't hit for restore-cache"
exit 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
id: build-docker
uses: docker/build-push-action@v4
with:
context: ./docker
push: false
cache-from: type=gha

- name: Error if cache doesn't hit for build-docker
if: steps.build-docker.outputs.cache-hit == 'false'
run: |
echo "Cache didn't hit for build-docker"
exit 1
10 changes: 10 additions & 0 deletions .github/workflows/test_save_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@ jobs:
myfolder
myfolder2
key: cached_folders

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: ./docker
push: false
cache-to: type=gha,mode=max
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM alpine:latest

RUN apk add --no-cache curl

0 comments on commit 4295867

Please sign in to comment.