mirror of
https://github.com/docker/build-push-action.git
synced 2025-11-16 12:23:59 +08:00
ci(e2e): test s3 cache exporter
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
30
.github/workflows/.e2e-run.yml
vendored
30
.github/workflows/.e2e-run.yml
vendored
@@ -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: |
|
||||
|
||||
6
.github/workflows/e2e.yml
vendored
6
.github/workflows/e2e.yml
vendored
@@ -25,6 +25,11 @@ jobs:
|
||||
name: Distribution
|
||||
id: distribution
|
||||
type: local
|
||||
-
|
||||
name: Distribution (s3 cache)
|
||||
id: distribution
|
||||
type: local
|
||||
cache: s3
|
||||
-
|
||||
name: Docker Hub
|
||||
registry: ''
|
||||
@@ -104,4 +109,5 @@ jobs:
|
||||
slug: ${{ matrix.slug }}
|
||||
username_secret: ${{ matrix.username_secret }}
|
||||
password_secret: ${{ matrix.password_secret }}
|
||||
cache: ${{ matrix.cache || 'registry' }}
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user