aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/workflows/test.go
blob: 7920ad01e4e563777ab5c6659bc17c41750e4821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//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:   "rosa",

			Steps: []Step{
				fixup,
				checkout,
				newCIRequest("distribution", "dist -o result", "dist-test"),
				newUploadArtifact(
					"distribution",
					"hakurei-${{ steps.dist-test.outputs.version }}",
				),
			},
		}},
	},
}).mustWriteFile("test")