ci(e2e): test s3 cache exporter

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-11-13 19:44:22 +01:00
parent 9e436ba9f2
commit 6909fbc5b1
2 changed files with 34 additions and 2 deletions

View File

@@ -25,6 +25,10 @@ on:
password_secret:
required: false
type: string
cache:
required: false
type: string
default: registry
env:
HARBOR_VERSION: v2.13.2
@@ -56,6 +60,24 @@ jobs:
if: inputs.type == 'local'
run: |
cat ./.github/e2e/${{ inputs.id }}/env >> $GITHUB_ENV
-
name: Set up outputs
uses: actions/github-script@v8
env:
INPUT_SLUG: ${{ env.REGISTRY_SLUG || inputs.slug }}
INPUT_CACHE: ${{ inputs.cache }}
with:
script: |
const inpSlug = core.getInput('slug');
const inpCache = core.getInput('cache');
if (inpCache === 'registry') {
core.exportVariable('CACHE_FROM', `type=registry,ref=${inpSlug}:master`);
core.exportVariable('CACHE_TO', 'type=inline');
} else if (inpCache === 's3') {
const cacheName = inpSlug.replace(/[^a-zA-Z0-9]/g, '-').toLowerCase();
core.exportVariable('CACHE_FROM', `type=s3,region=us-east-2,bucket=buildkit-s3-cache-test,name=${cacheName}`);
core.exportVariable('CACHE_TO', `type=s3,region=us-east-2,bucket=buildkit-s3-cache-test,name=${cacheName}`);
}
-
name: Set up BuildKit config
run: |
@@ -121,8 +143,12 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY_SLUG || inputs.slug }}:master
cache-to: type=inline
cache-from: ${{ env.CACHE_FROM }}
cache-to: ${{ env.CACHE_TO }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_S3_SESSION_TOKEN }}
-
name: Inspect image
run: |