1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Add workflow to accept snapshots via kitdiff (#7577)

This adds a new workflow `update_kittest_snapshots.yml` that can be
triggered through the [kitdiff](https://github.com/rerun-io/kitdiff) ui
when viewing a ci artefact.
Also adds a link to kitdiff to view the pr changes to each commit (via
the preview build comment)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Lucas Meurer
2025-10-06 15:57:31 +02:00
committed by GitHub
parent f6fe3bff18
commit f0faacc7d1
5 changed files with 77 additions and 11 deletions

View File

@@ -17,6 +17,20 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
env:
URL_SLUG: ${{ github.event.number }}-${{ github.head_ref }}
with:
message: |
Preview is being built...
Preview will be available at https://egui-pr-preview.github.io/pr/${{ env.URL_SLUG }}
View snapshot changes at [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{ github.event.pull_request.html_url }})
comment_tag: 'egui-preview'
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:

View File

@@ -61,5 +61,7 @@ jobs:
message: |
Preview available at https://egui-pr-preview.github.io/pr/${{ env.URL_SLUG }}
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.
View snapshot changes at [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{ github.event.pull_request.html_url }})
pr_number: ${{ env.PR_NUMBER }}
comment_tag: 'egui-preview'

View File

@@ -0,0 +1,40 @@
on:
workflow_dispatch:
inputs:
run_id:
description: 'The run ID that produced the artifact'
required: true
type: string
permissions:
actions: read
name: Update kittest snapshots
jobs:
update-snapshots:
name: Update snapshots from artifact
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
lfs: true
# We can't use the workflow token since that would prevent our commit to cause further workflows.
# See https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Accept snapshots
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.inputs.run_id }}
run: ./scripts/update_snapshots_from_ci.sh
- name: Git status
run: git status
- uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: 'Update snapshot images'