//go:build workflows package main var _ = (&Workflow{ Name: "Test", On: []any{"push"}, Jobs: Map[Job]{ {K: "hakurei", V: Job{ Name: "Hakurei", On: "nix", Steps: []Step{ checkout, newNixOSTest("hakurei"), newUploadArtifact("test output", "hakurei-vm-output"), }, }}, {K: "race", V: Job{ Name: "Hakurei (race detector)", On: "nix", Steps: []Step{ checkout, newNixOSTest("race"), newUploadArtifact("test output", "hakurei-race-vm-output"), }, }}, {K: "sandbox", V: Job{ Name: "Sandbox", On: "nix", Steps: []Step{ checkout, newNixOSTest("sandbox"), newUploadArtifact("test output", "sandbox-vm-output"), }, }}, {K: "sandbox-race", V: Job{ Name: "Sandbox (race detector)", On: "nix", Steps: []Step{ checkout, newNixOSTest("sandbox-race"), newUploadArtifact("test output", "sandbox-race-vm-output"), }, }}, {K: "sharefs", V: Job{ Name: "ShareFS", On: "nix", Steps: []Step{ checkout, newNixOSTest("sharefs"), newUploadArtifact("test output", "sharefs-vm-output"), }, }}, {K: "check", V: Job{ Name: "Flake checks", On: "nix", Needs: []string{ "hakurei", "race", "sandbox", "sandbox-race", "sharefs", }, Steps: []Step{ checkout, { Name: "Run checks", Run: "nix " + "--print-build-logs " + "--experimental-features 'nix-command flakes' " + "flake check ./test", }, }, }}, {K: "dist", V: Job{ Name: "Create distribution", On: "nix", Steps: []Step{ checkout, { Name: "Build for test", ID: "build-test", Run: "export HAKUREI_REV=\"$(git rev-parse --short HEAD)\" && " + "sed -i.old " + "'s/version = /version = \"0.0.0-'$HAKUREI_REV'\"; # version = /' " + "test/package.nix && " + "nix build --print-out-paths --print-build-logs ./test#dist && " + "mv test/{package.nix.old,package.nix} && " + "echo \"rev=$HAKUREI_REV\" >> $GITHUB_OUTPUT", }, newUploadArtifact( "test build", "hakurei-${{ steps.build-test.outputs.rev }}", ), }, }}, }, }).mustWriteFile("test")