Compare commits

..

2 Commits

Author SHA1 Message Date
CrazyMax
22fab6b495
Merge aca01f02d5 into 4b0752a2b1 2023-08-09 10:38:25 +00:00
CrazyMax
aca01f02d5
e2e: test buildx and buildkit edge
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-08-09 12:37:34 +02:00
2 changed files with 35 additions and 52 deletions

View File

@ -19,11 +19,12 @@ on:
slug: slug:
required: false required: false
type: string type: string
secrets: username_secret:
username:
required: false required: false
password: type: string
password_secret:
required: false required: false
type: string
env: env:
HARBOR_VERSION: v2.7.0 HARBOR_VERSION: v2.7.0
@ -36,12 +37,13 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
buildx_version: include:
- latest -
- https://github.com/docker/buildx.git#master buildx_version: latest
buildkit_image: buildkit_image: moby/buildkit:buildx-stable-1
- moby/buildkit:buildx-stable-1 -
- moby/buildkit:master buildx_version: https://github.com/docker/buildx.git#master
buildkit_image: moby/buildkit:master
steps: steps:
- -
name: Checkout name: Checkout
@ -78,11 +80,11 @@ jobs:
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: ${{ inputs.slug }} images: ${{ env.REGISTRY_SLUG || inputs.slug }}
tags: | tags: |
type=ref,event=branch type=ref,event=branch,enable=${{ matrix.buildx_version == 'latest' && matrix.buildkit_image == 'moby/buildkit:buildx-stable-1' }}
type=ref,event=tag type=ref,event=tag,enable=${{ matrix.buildx_version == 'latest' && matrix.buildkit_image == 'moby/buildkit:buildx-stable-1' }}
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }} type=raw,gh-runid-${{ github.run_id }}
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
@ -90,20 +92,20 @@ jobs:
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
with: with:
version: ${{ inputs.buildx-version || matrix.buildx_version }} version: ${{ matrix.buildx_version }}
config: /tmp/buildkitd.toml config: /tmp/buildkitd.toml
buildkitd-flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host buildkitd-flags: --debug --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
driver-opts: | driver-opts: |
image=${{ inputs.buildkit-image || matrix.buildkit_image }} image=${{ matrix.buildkit_image }}
network=host network=host
- -
name: Login to Registry name: Login to Registry
if: github.event_name != 'pull_request' && secrets.username != '' if: github.event_name != 'pull_request' && (env.REGISTRY_USER || inputs.username_secret) != ''
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ${{ inputs.registry }} registry: ${{ env.REGISTRY_FQDN || inputs.registry }}
username: ${{ secrets.username }} username: ${{ env.REGISTRY_USER || secrets[inputs.username_secret] }}
password: ${{ secrets.password }} password: ${{ env.REGISTRY_PASSWORD || secrets[inputs.password_secret] }}
- -
name: Build and push name: Build and push
uses: ./ uses: ./
@ -114,14 +116,14 @@ jobs:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ inputs.slug }}:master cache-from: type=registry,ref=${{ env.REGISTRY_SLUG || inputs.slug }}:master
cache-to: type=inline cache-to: type=inline
- -
name: Inspect image name: Inspect image
run: | run: |
docker pull ${{ inputs.slug }}:${{ steps.meta.outputs.version }} docker pull ${{ env.REGISTRY_SLUG || inputs.slug }}:${{ steps.meta.outputs.version }}
docker image inspect ${{ inputs.slug }}:${{ steps.meta.outputs.version }} docker image inspect ${{ env.REGISTRY_SLUG || inputs.slug }}:${{ steps.meta.outputs.version }}
- -
name: Check manifest name: Check manifest
run: | run: |
docker buildx imagetools inspect ${{ inputs.slug }}:${{ steps.meta.outputs.version }} --format '{{json .}}' docker buildx imagetools inspect ${{ env.REGISTRY_SLUG || inputs.slug }}:${{ steps.meta.outputs.version }} --format '{{json .}}'

View File

@ -2,18 +2,6 @@ name: e2e
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
buildx-version:
description: 'Buildx version or Git context'
default: 'latest'
required: false
buildkit-image:
description: 'BuildKit image'
default: 'moby/buildkit:buildx-stable-1'
required: false
tag:
description: 'Additional tag to push'
required: false
schedule: schedule:
- cron: '0 10 * * *' - cron: '0 10 * * *'
push: push:
@ -24,7 +12,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest uses: ./.github/workflows/.e2e-run.yml
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -111,19 +99,12 @@ jobs:
name: Nexus name: Nexus
id: nexus id: nexus
type: local type: local
steps: with:
- id: ${{ matrix.id }}
name: Set up env type: ${{ matrix.type }}
if: matrix.type == 'local' name: ${{ matrix.name }}
run: | registry: ${{ matrix.registry }}
cat ./.github/e2e/${{ matrix.id }}/env >> $GITHUB_ENV slug: ${{ matrix.slug }}
- username_secret: ${{ matrix.username_secret }}
uses: ./.github/workflows/.e2e-run.yml password_secret: ${{ matrix.password_secret }}
with: secrets: inherit
id: ${{ matrix.id }}
type: ${{ matrix.type }}
name: ${{ matrix.name }}
registry: ${{ env.REGISTRY_FQDN || matrix.registry }}
slug: ${{ env.REGISTRY_SLUG || matrix.slug }}
username: ${{ env.REGISTRY_USER || secrets[matrix.username_secret] }}
password: ${{ env.REGISTRY_PASSWORD || secrets[matrix.password_secret] }}