|
1 | | -self: system: |
2 | | - |
3 | 1 | let |
4 | | - inherit (self.inputs.tullia.inputs.nixpkgs) lib; |
5 | | - |
6 | 2 | ciInputName = "GitHub event"; |
| 3 | + repository = "input-output-hk/daedalus"; |
7 | 4 | in |
8 | 5 | rec { |
9 | | - tasks = |
10 | | - let |
11 | | - inherit (self.inputs.tullia) flakeOutputTasks taskSequence; |
12 | | - |
13 | | - common = |
14 | | - { config |
15 | | - , ... |
16 | | - }: { |
17 | | - preset = { |
18 | | - # needed on top-level task to set runtime options |
19 | | - nix.enable = true; |
20 | | - |
21 | | - github-ci = { |
22 | | - # Tullia tasks can run locally or on Cicero. |
23 | | - # When no facts are present we know that we are running locally and vice versa. |
24 | | - # When running locally, the current directory is already bind-mounted |
25 | | - # into the container, so we don't need to fetch the source from GitHub |
26 | | - # and we don't want to report a GitHub status. |
27 | | - enable = config.actionRun.facts != { }; |
28 | | - repo = "input-output-hk/daedalus"; |
29 | | - sha = config.preset.github-ci.lib.getRevision ciInputName null; |
30 | | - }; |
31 | | - }; |
32 | | - }; |
33 | | - |
34 | | - ciTasks = __mapAttrs |
35 | | - (_: flakeOutputTask: { ... }: { |
36 | | - imports = [ common flakeOutputTask ]; |
37 | | - |
38 | | - memory = 1024 * 8; |
39 | | - nomad.resources.cpu = 10000; |
40 | | - }) |
41 | | - (flakeOutputTasks [ "hydraJobs" system ] self); |
42 | | - |
43 | | - ciTasksSeq = taskSequence "ci/" ciTasks (__attrNames ciTasks); |
44 | | - in |
45 | | - ciTasks // # for running tasks separately |
46 | | - ciTasksSeq // # for running in an arbitrary sequence |
47 | | - { |
48 | | - "ci" = { lib, ... }: { |
49 | | - imports = [ common ]; |
50 | | - after = __attrNames ciTasksSeq; |
| 6 | + tasks.ci = { config, lib, ... }: { |
| 7 | + preset = { |
| 8 | + nix.enable = true; |
| 9 | + |
| 10 | + github.ci = { |
| 11 | + # Tullia tasks can run locally or on Cicero. |
| 12 | + # When no facts are present we know that we are running locally and vice versa. |
| 13 | + # When running locally, the current directory is already bind-mounted |
| 14 | + # into the container, so we don't need to fetch the source from GitHub |
| 15 | + # and we don't want to report a GitHub status. |
| 16 | + enable = config.actionRun.facts != { }; |
| 17 | + inherit repository; |
| 18 | + revision = config.preset.github.lib.readRevision ciInputName null; |
51 | 19 | }; |
52 | 20 | }; |
53 | 21 |
|
54 | | - actions = { |
55 | | - "daedalus/ci" = { |
56 | | - task = "ci"; |
57 | | - io = '' |
58 | | - // This is a CUE expression that defines what events trigger a new run of this action. |
59 | | - // There is no documentation for this yet. Ask SRE if you have trouble changing this. |
60 | | - let github = { |
61 | | - #input: "${ciInputName}" |
62 | | - #repo: "input-output-hk/daedalus" |
63 | | - } |
64 | | - #lib.merge |
65 | | - #ios: [ |
66 | | - #lib.io.github_push & github, |
67 | | - { #lib.io.github_pr, github, #target_default: false }, |
68 | | - ] |
69 | | - ''; |
| 22 | + command.text = config.preset.github.status.lib.reportBulk { |
| 23 | + bulk.text = "nix eval .#hydraJobs --apply __attrNames --json | nix-systems -i"; |
| 24 | + each.text = ''nix build -L .#hydraJobs."$1".required''; |
| 25 | + skippedDescription = lib.escapeShellArg "No nix builder available for this system"; |
70 | 26 | }; |
| 27 | + |
| 28 | + memory = 1024 * 8; |
| 29 | + nomad.resources.cpu = 10000; |
| 30 | + }; |
| 31 | + |
| 32 | + actions."daedalus/ci" = { |
| 33 | + task = "ci"; |
| 34 | + io = '' |
| 35 | + // This is a CUE expression that defines what events trigger a new run of this action. |
| 36 | + // There is no documentation for this yet. Ask SRE if you have trouble changing this. |
| 37 | + let github = { |
| 38 | + #input: "${ciInputName}" |
| 39 | + #repo: "${repository}" |
| 40 | + } |
| 41 | + #lib.merge |
| 42 | + #ios: [ |
| 43 | + #lib.io.github_push & github, |
| 44 | + { #lib.io.github_pr, github, #target_default: false }, |
| 45 | + ] |
| 46 | + ''; |
71 | 47 | }; |
72 | 48 | } |
0 commit comments