diff options
Diffstat (limited to 'internal/workflows/step.go')
| -rw-r--r-- | internal/workflows/step.go | 50 |
1 files changed, 16 insertions, 34 deletions
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 { |
