From d300e8f3c09a99d7cc3013042f93e288e20ea8bf Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sat, 29 Jun 2024 00:08:55 -0400 Subject: [PATCH 1/3] Add validation of new protoc against Jaeger repos Signed-off-by: Yuri Shkuro --- .github/workflows/build-and-publish.yml | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index e122dfd..5b74f4b 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -56,3 +56,31 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 + + - name: Checkout Jaeger for validation + if: github.event_name == 'pull_request' + uses: actions/checkout@v4 + with: + repository: jaegertracing/jaeger + path: jaeger + + - name: Build Proto in Jaeger + if: github.event_name == 'pull_request' + working-directory: jaeger + run: | + make init-submodules + make proto JAEGER_DOCKER_PROTOBUF=protobuf + + - name: Checkout jaeger-idl for validation + if: github.event_name == 'pull_request' + uses: actions/checkout@v4 + with: + repository: jaegertracing/jaeger-idl + path: jaeger-idl + + - name: Build Proto in jaeger-idl + if: github.event_name == 'pull_request' + working-directory: jaeger-idl + run: | + make init-submodule + make proto PROTOC_IMAGE=protobuf From e2aa5206a981fe38f58c51699c28b37831b7ef0f Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sat, 29 Jun 2024 00:10:52 -0400 Subject: [PATCH 2/3] fix workflow Signed-off-by: Yuri Shkuro --- .github/workflows/build-and-publish.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 5b74f4b..2498ad2 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,8 +1,6 @@ name: Docker Image on: push: - tags: - - '**' branches: - main pull_request: @@ -10,6 +8,11 @@ on: - .github/workflows/jaeger-dockerimage.yml - Dockerfile - protoc-wrapper + release: + types: + - published + # allow running release workflow manually + workflow_dispatch: jobs: build: From f5094b865cc82bec24123f704b2a5bdba0323fe2 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sat, 29 Jun 2024 00:18:09 -0400 Subject: [PATCH 3/3] cleanup Signed-off-by: Yuri Shkuro --- .github/workflows/build-and-publish.yml | 28 +++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 2498ad2..2089c78 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,16 +1,15 @@ name: Docker Image on: push: - branches: - - main + branches: [main] pull_request: + branches: [main] paths: - - .github/workflows/jaeger-dockerimage.yml - - Dockerfile - - protoc-wrapper + - .github/workflows/jaeger-dockerimage.yml + - Dockerfile + - protoc-wrapper release: - types: - - published + types: [published] # allow running release workflow manually workflow_dispatch: @@ -60,30 +59,33 @@ jobs: cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 + # The following steps run only on pull requests and validate + # that the new image can run successfully in Jaeger repos. + # We do not check if the generated files would be different there, + # only that the build does not fail. + - name: Checkout Jaeger for validation if: github.event_name == 'pull_request' uses: actions/checkout@v4 with: repository: jaegertracing/jaeger + submodules: recursive path: jaeger - name: Build Proto in Jaeger if: github.event_name == 'pull_request' working-directory: jaeger - run: | - make init-submodules - make proto JAEGER_DOCKER_PROTOBUF=protobuf + run: make proto JAEGER_DOCKER_PROTOBUF=protobuf - name: Checkout jaeger-idl for validation if: github.event_name == 'pull_request' uses: actions/checkout@v4 with: repository: jaegertracing/jaeger-idl + submodules: recursive path: jaeger-idl - name: Build Proto in jaeger-idl if: github.event_name == 'pull_request' working-directory: jaeger-idl - run: | - make init-submodule - make proto PROTOC_IMAGE=protobuf + run: make proto PROTOC_IMAGE=protobuf