From 5fce62d380f56a33ce93248bfa1376dd2267338d Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 9 Jun 2025 12:58:51 +0200 Subject: [PATCH 1/2] chore: updating tag format to handle PRs as well as tags --- .github/workflows/ci_release.yml | 3 ++ .github/workflows/docker-build-publish.yml | 20 ------------- .github/workflows/test.yml | 34 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/docker-build-publish.yml diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index fecf98a6c0..a39d452103 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -29,6 +29,9 @@ jobs: test: uses: ./.github/workflows/test.yml secrets: inherit + with: + # tag with the pr in the format of pr-1234 or the tag / branch if it is not a PR. + image-tag: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.ref_name }} proto: uses: ./.github/workflows/proto.yml diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml deleted file mode 100644 index fd9e537754..0000000000 --- a/.github/workflows/docker-build-publish.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Docker Build & Publish - -# Trigger on all push events, new semantic version tags, and all PRs -on: - push: - branches: - - "main" - tags: - - "v*" - pull_request: - -jobs: - rollkit-docker: - permissions: - contents: write - packages: write - uses: rollkit/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.5.0 # yamllint disable-line rule:line-length - with: - dockerfile: Dockerfile - secrets: inherit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd0f9d6ea1..3e8804d917 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,42 @@ name: Tests / Code Coverage on: workflow_call: + inputs: + image-tag: + required: true + type: string jobs: + build-docker-image: + name: Build docker image + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image with PR tag + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ghcr.io/${{ github.repository_owner }}/rollkit:${{ inputs.image-tag }} + + upgrade-tests: + needs: build-docker-image + runs-on: ubuntu-latest + steps: + - run: exit 0 # TODO: add upgrade test uses the image built in the build-docker-image step + build_all-apps: name: Build All Rollkit Binaries runs-on: ubuntu-latest From 3b24ece125ae6592e9ce89bc2532185482e6a1fd Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 9 Jun 2025 13:22:01 +0200 Subject: [PATCH 2/2] chore: fixed casing in name --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3e8804d917..57505b9e06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ on: jobs: build-docker-image: - name: Build docker image + name: Build Docker Image runs-on: ubuntu-latest steps: - name: Checkout code