Skip to content

Commit

Permalink
DRY cicero workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dermetfan committed Dec 3, 2021
1 parent 9583a87 commit 155e0a8
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions workflows/cicero.nix
Expand Up @@ -13,7 +13,10 @@ let
ciceropkg = pkg: "github:input-output-hk/cicero/${self.rev or ""}#${pkg}";

simple = [ wfLib.jobDefaults std.singleTask ];

setup = pr: with std; [
(lib.optionalAttrs (pr ? statuses_url) (github.reportStatus pr.statuses_url))
(git.clone pr.head)
];
in std.callWorkflow args {
actions = {
pr = { pr ? null, github-event ? { } }: {
Expand Down Expand Up @@ -41,9 +44,7 @@ in std.callWorkflow args {
};

job = with std;
simple ++ [
(github.reportStatus pr.statuses_url)
(git.clone pr.head)
simple ++ (setup pr) ++ [
{
resources.memory = 1024;
config.packages =
Expand All @@ -62,9 +63,7 @@ in std.callWorkflow args {
};

job = with std;
simple ++ [
(github.reportStatus pr.statuses_url)
(git.clone pr.head)
simple ++ (setup pr) ++ [
{
resources.memory = 2 * 1024;
config.packages = data-merge.append (map nixpkg [ "fd" "nixfmt" ]);
Expand All @@ -83,9 +82,7 @@ in std.callWorkflow args {
};

job = with std;
simple ++ [
(github.reportStatus pr.statuses_url)
(git.clone pr.head)
simple ++ (setup pr) ++ [
{
resources = {
memory = 4 * 1024;
Expand Down Expand Up @@ -121,9 +118,7 @@ in std.callWorkflow args {
};

job = with std;
simple ++ [
(github.reportStatus pr.statuses_url)
(git.clone pr.head)
simple ++ (setup pr) ++ [
{
resources.memory = 1024;
config.packages = data-merge.append (map nixpkg [ "cue" "nomad" ]);
Expand Down

0 comments on commit 155e0a8

Please sign in to comment.