-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add std flake and tullia Co-authored-by: Michael Peyton Jones <michael.peyton-jones@iohk.io>
- Loading branch information
Showing
8 changed files
with
564 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.follows = "std/nixpkgs"; | ||
std.url = github:divnix/std; | ||
tullia = { | ||
url = github:input-output-hk/tullia; | ||
inputs.std.follows = "std"; | ||
}; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
std, | ||
tullia, | ||
... | ||
} @ inputs: | ||
std.growOn { | ||
inherit inputs; | ||
cellsFrom = nix/cells; | ||
cellBlocks = [ | ||
(std.functions "library") | ||
(std.functions "hydraJobs") | ||
(tullia.tasks "pipelines") | ||
(std.functions "actions") | ||
]; | ||
} | ||
( | ||
tullia.fromStd { | ||
actions = std.harvest self ["cloud" "actions"]; | ||
tasks = std.harvest self ["automation" "pipelines"]; | ||
} | ||
) | ||
{ | ||
hydraJobs = std.harvest self ["automation" "hydraJobs"]; | ||
}; | ||
|
||
nixConfig = { | ||
extra-substituters = ["https://cache.iog.io"]; | ||
extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="]; | ||
allow-import-from-derivation = true; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
cell, | ||
inputs, | ||
}: | ||
|
||
import "${inputs.self}/release.nix" { | ||
cardano-base = inputs.self; | ||
supportedSystems = [inputs.nixpkgs.system]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
inputs, | ||
cell, | ||
}: let | ||
inherit (inputs.tullia) flakeOutputTasks taskSequence; | ||
inherit (inputs.nixpkgs) system lib; | ||
|
||
common = {config, ...}: { | ||
preset = { | ||
# needed on top-level task to set runtime options | ||
nix.enable = true; | ||
|
||
github-ci = { | ||
# Tullia tasks can run locally or on Cicero. | ||
# When no facts are present we know that we are running locally and vice versa. | ||
# When running locally, the current directory is already bind-mounted into the container, | ||
# so we don't need to fetch the source from GitHub and we don't want to report a GitHub status. | ||
enable = config.actionRun.facts != {}; | ||
repo = "input-output-hk/cardano-base"; | ||
sha = config.preset.github-ci.lib.getRevision inputs.cells.cloud.library.actionCiInputName null; | ||
}; | ||
}; | ||
}; | ||
|
||
ciTasks = | ||
__mapAttrs | ||
(_: flakeOutputTask: {...}: { | ||
imports = [common flakeOutputTask]; | ||
|
||
memory = 1024 * 8; | ||
nomad.resources.cpu = 10000; | ||
}) | ||
(flakeOutputTasks ["hydraJobs" system] { outputs.hydraJobs.${system} = cell.hydraJobs; }); | ||
|
||
ciTasksSeq = taskSequence "ci/" ciTasks ( | ||
# make sure the aggregate is built last | ||
let | ||
required = "hydraJobs.${system}.required"; | ||
all = __attrNames ciTasks; | ||
in | ||
assert __elem required all; | ||
lib.remove required all ++ [required] | ||
); | ||
in | ||
ciTasks # for running separately | ||
// ciTasksSeq # for running in an arbitrary sequence | ||
// { | ||
"ci" = {lib, ...}: { | ||
imports = [common]; | ||
after = __attrNames ciTasksSeq; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
cell, | ||
inputs, | ||
}: { | ||
"cardano-base/ci" = { | ||
task = "ci"; | ||
io = '' | ||
// This is a CUE expression that defines what events trigger a new run of this action. | ||
// There is no documentation for this yet. Ask SRE if you have trouble changing this. | ||
let github = { | ||
#input: "${cell.library.actionCiInputName}" | ||
#repo: "input-output-hk/cardano-base" | ||
} | ||
#lib.merge | ||
#ios: [ | ||
#lib.io.github_push & github, | ||
{ #lib.io.github_pr, github, #target_default: false }, | ||
] | ||
''; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
inputs, | ||
cell, | ||
}: { | ||
actionCiInputName = "GitHub event"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters