From 1f2734d092c94238b51fa8663951a246bd1ef3f4 Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Mon, 16 Dec 2024 12:16:55 +0100 Subject: [PATCH] Test ci-tools build --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd148204783..b038788be69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,10 +16,54 @@ concurrency: group: "${{ github.ref_name }}-${{ github.head_ref }}" cancel-in-progress: true +permissions: + contents: read + id-token: write + +env: + IMAGE_NAME: grafana/tempo-ci-tools + jobs: + + get-image-tag: + runs-on: ubuntu-24.04 + outputs: + tag: ${{ steps.get-tag.outputs.tag }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - id: get-tag + run: | + echo "tag=$(./tools/image-tag)" + echo "tag=$(./tools/image-tag)" >> "$GITHUB_OUTPUT" + + docker-ci-tools: + needs: get-image-tag + strategy: + matrix: + runner_arch: [ { runner: ubuntu-24.04, arch: amd64 }, { runner: github-hosted-ubuntu-arm64, arch: arm64 } ] + runs-on: ${{ matrix.runner_arch.runner }} + env: + TAG: ${{ needs.get-image-tag.outputs.tag }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to DockerHub + uses: grafana/shared-workflows/actions/dockerhub-login@dockerhub-login-v1.0.0 + + - name: docker-build-and-push + run: | + TAG_ARCH="$TAG-${{ matrix.runner_arch.arch }}" + docker build -f tools/Dockerfile -t $IMAGE_NAME:$TAG_ARCH . + docker push $IMAGE_NAME:$TAG_ARCH + + + lint: name: Lint - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check out code @@ -55,7 +99,7 @@ jobs: unit-tests: name: Run Unit Tests - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: test-target: @@ -80,7 +124,7 @@ jobs: integration-tests: name: Run integration tests - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest strategy: matrix: test-target: @@ -105,7 +149,7 @@ jobs: build: name: Build - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 @@ -132,7 +176,7 @@ jobs: benchmark: name: Benchmark - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 @@ -147,7 +191,7 @@ jobs: vendor-check: name: Vendor check - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 @@ -165,7 +209,7 @@ jobs: tempo-jsonnet: name: Check jsonnet & tempo-mixin - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 @@ -186,7 +230,7 @@ jobs: build-technical-documentation: name: Build technical documentation - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4