Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
92 changes: 92 additions & 0 deletions .github/workflows/RegenSnapshotGoldens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Regenerate Snapshot Goldens

on:
pull_request:
types: [labeled]

permissions:
contents: read
pull-requests: read

defaults:
run:
shell: bash

jobs:
# Build guests once, upload as artifacts for the regen jobs to
# download. Mirrors `build-guests` in `ValidatePullRequest.yml`.
build-guests:
if: github.event.label.name == 'regen-goldens'
strategy:
fail-fast: false
matrix:
config: [debug]
uses: ./.github/workflows/dep_build_guests.yml
secrets: inherit
with:
docs_only: "false"
config: ${{ matrix.config }}

regen:
if: github.event.label.name == 'regen-goldens'
needs: [build-guests]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
hypervisor: ['hyperv-ws2025', mshv3, kvm]
cpu: [amd, intel]
runs-on: ${{ fromJson(
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=regen-goldens-{3}-{4}-{5}-{6}"]',
matrix.hypervisor == 'hyperv-ws2025' && 'Windows' || 'Linux',
matrix.hypervisor == 'hyperv-ws2025' && 'win2025' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor,
matrix.cpu,
matrix.hypervisor,
github.run_id,
github.run_number,
github.run_attempt)) }}
steps:
- uses: actions/checkout@v6

- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fix cargo home permissions
if: runner.os == 'Linux'
run: |
sudo chown -R $(id -u):$(id -g) /opt/cargo || true

- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-debug"
cache-on-failure: "true"

- name: Download Rust guests
uses: actions/download-artifact@v8
with:
name: rust-guests-debug
path: src/tests/rust_guests/bin/debug/

- name: Run regen
env:
HYPERLIGHT_REGEN_GOLDENS: "1"
run: |
cargo test -p hyperlight-host --lib \
sandbox::snapshot::golden_tests::golden_regen \
-- --nocapture

- name: Upload regenerated fixtures
uses: actions/upload-artifact@v4
with:
name: goldens-${{ matrix.hypervisor }}-${{ matrix.cpu }}
path: src/hyperlight_host/tests/snapshot_goldens/fixtures/*.hls
# Fail loudly if the regen produced nothing rather than
# silently uploading an empty artifact.
if-no-files-found: error
retention-days: 14
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading