Skip to content
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ on:
tags: ["v*"]
branches: [ main ]
workflow_dispatch:
# Run on pull requests to test docker build.
# We explicitly do not push on pull requests (the job below is ended early).
# Run on pull requests so that the docker build is tested.
#
# We explicitly do not push on pull requests (see `if` conditionals and `push`
# attribute of `docker/build-push-action` below). This prevents us from filling
# up the container registries with in-progress builds.
#
# note: secrets will not be populated on pull requests from external authors.
pull_request:
Expand Down Expand Up @@ -38,32 +41,29 @@ jobs:
type=sha,prefix=,format=long

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused how/why we can't see the failures from #158 ?

Do we need to require some jobs succeed in order to notice this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - indeed it looks like we do. I've added a ruleset that requires all CI checks complete -> https://github.com/matrix-org/rust-synapse-compress-state/settings/rules/7412288

And now we can see that build is not passing on #160 (as this PR hasn't merged yet). Whereas before it was just completely green.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better than nothing. I wish we could see the failure as well.

Currently, it just says "Waiting for status to be reported" without any link to see the syntax problem

2025-08-14_13-42

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, and I wish you could just click on "build" there instead of needing to go to the Checks tab and clicking on the workflow. But it's a strong signal at the very least.

type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}

- name: Don't push to registry if this is a PR
if: "${{ github.event_name }}" = "pull_request"
run: |
echo "Not pushing the image to any container registry as this workflow is running on a pull request"
exit 0

- name: Log in to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push all platforms
uses: docker/build-push-action@v4
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
push: true
# Always build, but don't push to container registries on PRs.
push: ${{ github.event_name != 'pull_request' }}
labels: "gitsha1=${{ github.sha }}"
tags: "${{ steps.set-tag.outputs.tags }}"
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading