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..57505b9e06 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