diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-01 17:00:46 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-01 21:44:30 +0900 |
| commit | 6a144f780ab62a5e6936d8f551dd03f51b11a153 (patch) | |
| tree | d3bb149739945becd2d0330d678f7ada620953f4 /internal/workflows/step.go | |
| parent | a356dceedf0be29ae584866e540872ec1c048f59 (diff) | |
test/sharefs: migrate tests
This runs tests directly in the container, significantly reducing
overhead introduced by virtualisation.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/workflows/step.go')
| -rw-r--r-- | internal/workflows/step.go | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/internal/workflows/step.go b/internal/workflows/step.go index 423a48ff..219ed78b 100644 --- a/internal/workflows/step.go +++ b/internal/workflows/step.go @@ -12,6 +12,16 @@ var fixup = Step{ // checkout is the standard actions/checkout step. var checkout = Step{Name: "Checkout", Uses: "actions/checkout@v4"} +// toolchain is a step for setting up the Go toolchain. +var toolchain = Step{ + Name: "Set up Go toolchain", + Uses: "actions/setup-go@v6", + + With: []KV[any]{ + {"go-version-file", "go.mod"}, + }, +} + // newUploadArtifact returns an actions/upload-artifact step uploading // everything in the result directory as the specified name. func newUploadArtifact(display, name string) Step { @@ -33,13 +43,23 @@ func newCIRequest(display, name, id string) Step { return Step{ Name: "Request " + display, ID: id, - Run: "export HAKUREI_REV=\"$(git rev-parse --short HEAD)\" && " + + Run: "HAKUREI_REV=\"$(git rev-parse --short HEAD)\" && " + "/rosa/bin/mbf ci " + name + " " + ". \"$(cat cmd/dist/VERSION)-$HAKUREI_REV\" && " + "echo \"rev=$HAKUREI_REV\" >> \"$GITHUB_OUTPUT\"", } } +// install is a step to unpack and deploy a hakurei distribution created by a +// step with identifier dist. +var install = Step{ + Name: "Install hakurei", + Run: "HAKUREI_VERSION=\"$(cat cmd/dist/VERSION)-${{ steps.dist.outputs.rev }}\" && " + + "tar xf \"result/hakurei-$HAKUREI_VERSION-amd64.tar.gz\" && " + + "\"./hakurei-$HAKUREI_VERSION-amd64/install.sh\" && " + + "sudo -u ubuntu hakurei version", +} + // newNixOSTest returns a step for running the named NixOS test. func newNixOSTest(name string) Step { return Step{ |
