//go:build workflows package main // fixup is a step to work around a Podman regression introduced by a bad // container escape mitigation. var fixup = Step{ Name: "Fix container filesystem", Run: "rm /var/run && ln -sf ../run /var", } // checkout is the standard actions/checkout step. var checkout = Step{Name: "Checkout", Uses: "actions/checkout@v4"} // clone is a simple actions/checkout replacement. var clone = Step{ Name: "Checkout", Run: "git clone " + "-c advice.detachedHead=0 " + "--rev='${{ github.sha }}' " + "'${{ github.server_url }}/${{ github.repository }}.git' . && " + "git fetch --tags", } // newUploadArtifact returns an actions/upload-artifact step uploading // everything in the result directory as the specified name. func newUploadArtifact(display, name string) Step { return Step{ Name: "Upload " + display, Uses: "actions/upload-artifact@v3", With: Map[any]{ {K: "name", V: name}, {K: "path", V: "result/*"}, {K: "retention-days", V: 1}, }, } } // newCIRequest returns a step for requesting a mbf CI task. func newCIRequest(display, name, id string) Step { return Step{ Name: "Request " + display, ID: id, Run: "export HAKUREI_VERSION=\"$(git describe --dirty)\" && " + "/rosa/bin/mbf ci " + name + " . \"$HAKUREI_VERSION\" && " + "echo \"version=$HAKUREI_VERSION\" >> \"$GITHUB_OUTPUT\"", } } // newNixOSTest returns a step for running the named NixOS test. func newNixOSTest(name string) Step { return Step{ Name: "Run NixOS test", Run: "nix build " + "--out-link result " + "--print-out-paths " + "--print-build-logs " + "./test#checks.x86_64-linux." + name, } }