aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/workflows/step.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/workflows/step.go')
-rw-r--r--internal/workflows/step.go34
1 files changed, 31 insertions, 3 deletions
diff --git a/internal/workflows/step.go b/internal/workflows/step.go
index 219ed78b..83d9c5f3 100644
--- a/internal/workflows/step.go
+++ b/internal/workflows/step.go
@@ -2,6 +2,8 @@
package main
+import "strings"
+
// fixup is a step to work around a Podman regression introduced by a bad
// container escape mitigation.
var fixup = Step{
@@ -55,9 +57,35 @@ func newCIRequest(display, name, id string) Step {
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",
+ "tar xf result/hakurei-$HAKUREI_VERSION*-amd64.tar.gz && " +
+ "./hakurei-$HAKUREI_VERSION*-amd64/install.sh && " +
+ "sudo -u ubuntu hakurei version && " +
+ "echo 'Defaults closefrom_override' > " +
+ "/etc/sudoers.d/closefrom_override && " +
+ "mkdir /var/empty",
+}
+
+// newTestsuite returns a step for running an integration test suite.
+func newTestsuite(name, prefix string) Step {
+ return Step{
+ Name: "Compile and run test suite",
+ Run: prefix + "rm -rf result && " +
+ "go run -tags=testsuite ./test/" + name,
+ }
+}
+
+// newPackages returns a job for installing the specified packages with
+// best-effort caching. Package names must not contain spaces.
+func newPackages(rev int, packages ...string) Step {
+ return Step{
+ Name: "Install packages",
+ Uses: "awalsh128/cache-apt-pkgs-action@v1",
+ With: []KV[any]{
+ {"packages", strings.Join(packages, " ")},
+ {"version", rev},
+ {"execute_install_scripts", true},
+ },
+ }
}
// newNixOSTest returns a step for running the named NixOS test.