aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/workflows/test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/workflows/test.go')
-rw-r--r--internal/workflows/test.go150
1 files changed, 150 insertions, 0 deletions
diff --git a/internal/workflows/test.go b/internal/workflows/test.go
new file mode 100644
index 00000000..1f9bba58
--- /dev/null
+++ b/internal/workflows/test.go
@@ -0,0 +1,150 @@
+//go:build workflows
+
+package main
+
+var _ = (&Workflow{
+ Name: "Test",
+ On: []any{"push"},
+
+ Jobs: Map[Job]{
+ {"hakurei-legacy", Job{
+ Name: "Hakurei (legacy)",
+ On: "nix",
+
+ Steps: []Step{
+ checkout,
+ newNixOSTest("hakurei"),
+ newUploadArtifact("test output", "hakurei-vm-output"),
+ },
+ }},
+
+ {"hakurei-race-legacy", Job{
+ Name: "Hakurei (legacy with race instrument)",
+ On: "nix",
+
+ Steps: []Step{
+ checkout,
+ newNixOSTest("race"),
+ newUploadArtifact("test output", "hakurei-race-vm-output"),
+ },
+ }},
+
+ {"sandbox", Job{
+ Name: "Sandbox",
+ On: "rosa",
+
+ Needs: []string{"dist"},
+ Steps: []Step{
+ fixup,
+ checkout,
+ toolchain,
+ newPackages(0, []string{"ppa:savoury1/pipewire"},
+ "libmount-dev",
+ "sway",
+ "xwayland",
+ "xdg-dbus-proxy",
+ "pipewire",
+ ),
+
+ download,
+ install,
+ newTestsuite("hakurei/testsuite/sandbox", ""),
+ },
+ }},
+
+ {"sandbox-race", Job{
+ Name: "Sandbox (with race instrument)",
+ On: "rosa",
+
+ Needs: []string{"dist-race"},
+ Steps: []Step{
+ fixup,
+ checkout,
+ toolchain,
+
+ newPackages(0, []string{"ppa:savoury1/pipewire"},
+ "libmount-dev",
+ "sway",
+ "xwayland",
+ "xdg-dbus-proxy",
+ "pipewire",
+ ),
+
+ _download,
+ install,
+ newTestsuite("hakurei/testsuite/sandbox", ""),
+ },
+ }},
+
+ {"sharefs", Job{
+ Name: "ShareFS",
+ On: "rosa",
+
+ Needs: []string{"dist"},
+ Steps: []Step{
+ fixup,
+ checkout,
+ toolchain,
+ newPackages(0, nil, "fuse3", "fsmark"),
+
+ download,
+ install,
+
+ {
+ Name: "Mount sharefs",
+ Run: "useradd " +
+ "-ru 1023 " +
+ "-md /var/lib/sdcard " +
+ "-k /var/empty " +
+ "-s /sbin/nologin " +
+ "media_rw && install -dm0 /sdcard && " +
+ "sharefs " +
+ "-o rw,noexec,nosuid,nodev,noatime," +
+ "allow_other,mkdir,source=/var/lib/sdcard," +
+ "setuid=1023,setgid=1023 /sdcard",
+ },
+
+ newTestsuite("sharefs/testsuite", "sharefs -V && "),
+ newUploadArtifact("test output", "fs_mark"),
+ },
+ }},
+
+ {"dist", Job{
+ Name: "Create distribution",
+ On: "rosa",
+
+ Outputs: []KV[string]{
+ {"rev", "${{ steps.dist.outputs.rev }}"},
+ },
+
+ Steps: []Step{
+ fixup,
+ 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{
+ fixup,
+ checkout,
+ newCIRequest("distribution", "race -o result", "dist"),
+ newUploadArtifact(
+ "distribution",
+ "dist-${{ steps.dist.outputs.rev }}-race",
+ ),
+ },
+ }},
+ },
+}).mustWriteFile("test")