From ee5cabd9e36d6a057074926e682639a4538faa5b Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Wed, 22 Feb 2023 11:54:31 +0000 Subject: [PATCH] e2e: add distribution tests Signed-off-by: Justin Chadwell --- .github/e2e/distribution/env | 5 +++++ .github/e2e/distribution/install.sh | 13 +++++++++++++ .github/workflows/e2e.yml | 6 +++++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/e2e/distribution/env create mode 100755 .github/e2e/distribution/install.sh diff --git a/.github/e2e/distribution/env b/.github/e2e/distribution/env new file mode 100644 index 0000000..3dfc985 --- /dev/null +++ b/.github/e2e/distribution/env @@ -0,0 +1,5 @@ +REGISTRY_FQDN=localhost:8080 +REGISTRY_SLUG=localhost:8080/test-docker-action + +DISTRIBUTION_HOST=localhost +DISTRIBUTION_PORT=8080 \ No newline at end of file diff --git a/.github/e2e/distribution/install.sh b/.github/e2e/distribution/install.sh new file mode 100755 index 0000000..96d9343 --- /dev/null +++ b/.github/e2e/distribution/install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eu + +: "${DISTRIBUTION_VERSION:=registry:2}" +: "${DISTRIBUTION_HOST:=localhost}" +: "${DISTRIBUTION_PORT:=8080}" + +echo "::group::Starting ${DISTRIBUTION_VERSION}}" +( + set -x + docker run -d --name registry -p "5000:${DISTRIBUTION_PORT}" "${DISTRIBUTION_VERSION}" +) +echo "::endgroup::" \ No newline at end of file diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ad83f33..bee9670 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -35,6 +35,10 @@ jobs: fail-fast: false matrix: include: + - + name: Distribution + id: distribution + type: local - name: Docker Hub registry: '' @@ -169,7 +173,7 @@ jobs: network=host - name: Login to Registry - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && env.REGISTRY_USER != '' uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY_FQDN || matrix.registry }}