diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-10-07 19:22:40 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-10-07 19:32:48 +0900 |
| commit | 1c0d8abc5a3d4bc803b0cb3785d7a03b6b5993a3 (patch) | |
| tree | d87d23171ba6de8ef6335f061e573d8b507a640c /internal | |
| parent | 1548b0b9778f4ca93a35e5d7645ec7c8064ad50f (diff) | |
internal/workflows: remove dedicated dist jobsstaging
It is much easier to obtain these dist tarballs via cmd/mbf, and gitea
has been acting up again, taking minutes of retrying before finally
accepting the artifacts. This change removes them altogether and reverts
to contacting the cmd/mbf CI service.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rwxr-xr-x | internal/workflows/build.sh | 2 | ||||
| -rw-r--r-- | internal/workflows/step.go | 50 | ||||
| -rw-r--r-- | internal/workflows/test.go | 45 |
3 files changed, 20 insertions, 77 deletions
diff --git a/internal/workflows/build.sh b/internal/workflows/build.sh index f7b266a0..2df8656e 100755 --- a/internal/workflows/build.sh +++ b/internal/workflows/build.sh @@ -1,5 +1,5 @@ #!/bin/sh -e TAG="git.gensokyo.uk/rosa/runner:latest" -podman build -t "$TAG" --format docker . +podman build -t "$TAG" --format docker "$(dirname -- "$0")" podman push "$TAG" diff --git a/internal/workflows/step.go b/internal/workflows/step.go index b53671b6..5175d4d5 100644 --- a/internal/workflows/step.go +++ b/internal/workflows/step.go @@ -33,41 +33,23 @@ func newCIRequest(display, name, id string) Step { } } -// download is a step to obtain a hakurei distribution. -var download = Step{ - Name: "Download hakurei distribution", - ID: "download", - Uses: "actions/download-artifact@v3", +var ( + // dist is a step to obtain a hakurei distribution. + dist = newCIRequest("distribution", "dist -o /tmp/dist", "dist") + // _dist is like dist, but with race instrument. + _dist = newCIRequest("distribution", "race -o /tmp/dist", "dist") - With: []KV[any]{ - {"name", "dist-${{ needs.dist.outputs.rev }}"}, - {"path", "/tmp/dist"}, - }, -} - -// _download is like download, but with race instrument. -var _download = Step{ - Name: "Download hakurei distribution", - ID: "download", - Uses: "actions/download-artifact@v3", - - With: []KV[any]{ - {"name", "dist-${{ needs.dist-race.outputs.rev }}-race"}, - {"path", "/tmp/dist"}, - }, -} - -// 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)\" && " + - "tar -C /tmp/dist " + - "-xf /tmp/dist/hakurei-$HAKUREI_VERSION*-amd64.tar.gz && " + - "/tmp/dist/hakurei-$HAKUREI_VERSION*-amd64/install.sh && " + - "rm -rf /tmp/dist && " + - "sudo -u ubuntu hakurei version", -} + // install is a step to unpack and deploy a hakurei distribution in /tmp/dist. + install = Step{ + Name: "Install hakurei", + Run: "HAKUREI_VERSION=\"$(cat cmd/dist/VERSION)\" && " + + "tar -C /tmp/dist " + + "-xf /tmp/dist/hakurei-$HAKUREI_VERSION*-amd64.tar.gz && " + + "/tmp/dist/hakurei-$HAKUREI_VERSION*-amd64/install.sh && " + + "rm -rf /tmp/dist && " + + "sudo -u ubuntu hakurei version", + } +) // newTestsuite returns a step for running an integration test suite. func newTestsuite(name, prefix string) Step { diff --git a/internal/workflows/test.go b/internal/workflows/test.go index 6cea7842..5ca795c6 100644 --- a/internal/workflows/test.go +++ b/internal/workflows/test.go @@ -33,10 +33,9 @@ var _ = (&Workflow{ Name: "Sandbox", On: "rosa", - Needs: []string{"dist"}, Steps: []Step{ checkout, - download, + dist, install, newTestsuite("hakurei/testsuite/sandbox", "unshare -n "), }, @@ -46,10 +45,9 @@ var _ = (&Workflow{ Name: "Sandbox (with race instrument)", On: "rosa", - Needs: []string{"dist-race"}, Steps: []Step{ checkout, - _download, + _dist, install, newTestsuite("hakurei/testsuite/sandbox", "unshare -n "), }, @@ -59,10 +57,9 @@ var _ = (&Workflow{ Name: "ShareFS", On: "rosa", - Needs: []string{"dist"}, Steps: []Step{ checkout, - download, + dist, install, { @@ -83,41 +80,5 @@ var _ = (&Workflow{ newUploadArtifact("test output", "fs_mark"), }, }}, - - {"dist", Job{ - Name: "Create distribution", - On: "rosa", - - Outputs: []KV[string]{ - {"rev", "${{ steps.dist.outputs.rev }}"}, - }, - - Steps: []Step{ - checkout, - newCIRequest("distribution", "dist -o result", "dist"), - newUploadArtifact( - "distribution", - "dist-${{ steps.dist.outputs.rev }}", - ), - }, - }}, - - {"dist-race", Job{ - Name: "Create distribution (with race instrument)", - On: "rosa", - - Outputs: []KV[string]{ - {"rev", "${{ steps.dist.outputs.rev }}"}, - }, - - Steps: []Step{ - checkout, - newCIRequest("distribution", "race -o result", "dist"), - newUploadArtifact( - "distribution", - "dist-${{ steps.dist.outputs.rev }}-race", - ), - }, - }}, }, }).mustWriteFile("test") |
