Skip to content

Commit

Permalink
ci: use specific docker cache mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Jul 3, 2023
1 parent 5b84683 commit 7d3a586
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/actions/docker/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ inputs:
platforms:
description: Docker image platform to build
default: amd64,arm64
cache_mounts:
description: Load cache mounts cache
cargo_profile:
description: Cargo build profile, i.e release or dev
default: release
Expand All @@ -35,7 +37,7 @@ runs:
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_token }}
if: inputs.dockerhub_token != ''
if: ${{ inputs.dockerhub_token != '' }}

- name: Set up QEMU
uses: docker/setup-qemu-action@master
Expand All @@ -58,8 +60,9 @@ runs:
- name: Load Docker mount cache
uses: dcginfra/buildkit-cache-dance/inject@main
if: ${{ inputs.cache_mounts != '' }}
with:
platforms: ${{ inputs.platforms }}
mounts: ${{ inputs.cache_mounts }}

- name: Set suffix
uses: actions/github-script@v6
Expand Down Expand Up @@ -120,5 +123,6 @@ runs:

- name: Save Docker mount cache
uses: dcginfra/buildkit-cache-dance/extract@main
if: ${{ inputs.cache_mounts != '' }}
with:
platforms: ${{ inputs.platforms }}
mounts: ${{ inputs.cache_mounts }}
32 changes: 32 additions & 0 deletions .github/workflows/all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ jobs:
- name: Load Docker mount cache
uses: dcginfra/buildkit-cache-dance/inject@main
with:
mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_wasm
unplugged_amd64
- name: Setup local network
run: yarn configure
Expand All @@ -115,6 +123,14 @@ jobs:

- name: Store Docker mount cache
uses: dcginfra/buildkit-cache-dance/extract@main
with:
mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_wasm
unplugged_amd64
- name: Run test suite
run: yarn test:suite
Expand Down Expand Up @@ -168,6 +184,14 @@ jobs:
- name: Load Docker mount cache
uses: dcginfra/buildkit-cache-dance/inject@main
with:
mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_wasm
unplugged_amd64
- name: Setup local network
run: yarn configure
Expand All @@ -180,6 +204,14 @@ jobs:

- name: Store Docker mount cache
uses: dcginfra/buildkit-cache-dance/extract@main
with:
mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_wasm
unplugged_amd64
- name: Run test suite in browsers
run: yarn test:suite:browsers
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/js-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ jobs:
- name: Load Docker mount cache
if: ${{ inputs.start-local-network }}
uses: dcginfra/buildkit-cache-dance/inject@main
with:
mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_wasm
unplugged_amd64
- name: Setup local network
run: yarn configure
Expand All @@ -131,6 +139,14 @@ jobs:
- name: Store Docker mount cache
if: ${{ inputs.start-local-network }}
uses: dcginfra/buildkit-cache-dance/extract@main
with:
mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_wasm
unplugged_amd64
- name: Run tests
run: yarn test --filter "${{ inputs.package }}"
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ jobs:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
push: true
image_tag: ${{steps.tag.outputs.result}}
cache_mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_arm64
release-dapi-docker-image:
name: Release DAPI to Docker Hub
Expand Down Expand Up @@ -133,6 +139,15 @@ jobs:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
push: true
image_tag: ${{steps.tag.outputs.result}}
cache_mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_arm64
target_wasm
unplugged_amd64
unplugged_arm64
release-test-suite-docker-image:
name: Release Test Suite to Docker Hub
Expand Down Expand Up @@ -163,6 +178,15 @@ jobs:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
push: true
image_tag: ${{steps.tag.outputs.result}}
cache_mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_arm64
target_wasm
unplugged_amd64
unplugged_arm64
release-envoy-docker-image:
name: Release Envoy to Docker Hub
Expand Down Expand Up @@ -222,6 +246,15 @@ jobs:
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
push: true
image_tag: ${{steps.tag.outputs.result}}
cache_mounts: |
cargo_registry_index
cargo_registry_cache
cargo_git
target_amd64
target_arm64
target_wasm
unplugged_amd64
unplugged_arm64
release-dashmate-packages:
name: Release Dashmate packages
Expand Down

0 comments on commit 7d3a586

Please sign in to comment.