From 6abf841b05fdf82e4229a873232f4e18f5c4bb79 Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Mon, 25 Sep 2023 13:28:30 +0200 Subject: [PATCH] Make it reusable Signed-off-by: Israel Blancas --- ...ublish-autoinstrumentation-e2e-images.yaml | 44 ++--------------- ...ublish-autoinstrumentation-e2e-images.yaml | 48 +++++++++++++++++++ 2 files changed, 53 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml diff --git a/.github/workflows/publish-autoinstrumentation-e2e-images.yaml b/.github/workflows/publish-autoinstrumentation-e2e-images.yaml index bf7dfe0944..d18a6a662e 100644 --- a/.github/workflows/publish-autoinstrumentation-e2e-images.yaml +++ b/.github/workflows/publish-autoinstrumentation-e2e-images.yaml @@ -18,42 +18,8 @@ concurrency: cancel-in-progress: true jobs: - dotnet: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/open-telemetry/opentelemetry-operator/dotnet-test - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Cache Docker layers - uses: actions/cache@v3 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to GitHub Package Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: tests/instrumentation-e2e-apps/dotnet - platforms: linux/arm64,linux/amd64 - push: ${{ github.event_name == 'push' }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache + golang: + uses: ./.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml + with: + language: golang + platforms: linux/arm64,linux/amd64,linux/s390x,linux/ppc64le diff --git a/.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml b/.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml new file mode 100644 index 0000000000..666ebe7626 --- /dev/null +++ b/.github/workflows/reusable-publish-autoinstrumentation-e2e-images.yaml @@ -0,0 +1,48 @@ +name: "Publish instrumentation E2E tests images" + +on: + workflow_call: + inputs: + language: + type: string + required: true + platforms: + type: string + required: true + +jobs: + publish-e2e-test-image: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to GitHub Package Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + tags: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-${{ inputs.language }} + context: tests/instrumentation-e2e-apps/${{ inputs.language }} + platforms: ${{ inputs.platforms }} + push: ${{ github.event_name == 'push' }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache