Skip to content

Commit

Permalink
Merge #4652
Browse files Browse the repository at this point in the history
4652: modernize CI r=disassembler a=dermetfan

- update tullia
- build all available platforms
  - report one github status each

Co-authored-by: Robin Stumm <[email protected]>
Co-authored-by: Samuel Leathers <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2022
2 parents 35b74ca + 08c3a4b commit 2225b10
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 60 deletions.
1 change: 0 additions & 1 deletion bench/locli/src/Cardano/Unlog/LogObject.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ViewPatterns #-}
Expand Down
1 change: 0 additions & 1 deletion cardano-tracer/src/Cardano/Tracer/MetaTrace.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
Expand Down
28 changes: 21 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@

cardano-mainnet-mirror.url = "github:input-output-hk/cardano-mainnet-mirror/nix";

tullia = {
url = "github:input-output-hk/tullia";
inputs.nixpkgs.follows = "nixpkgs";
};
tullia.url = "github:input-output-hk/tullia";

nix2container.url = "github:nlewo/nix2container";
};
Expand Down Expand Up @@ -403,7 +400,7 @@
};
};
} //
tullia.fromSimple system (import ./nix/tullia.nix self system)
tullia.fromSimple system (import ./nix/tullia.nix)
);

makeRequired = isPr: jobs: extra:
Expand Down
71 changes: 25 additions & 46 deletions nix/tullia.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,35 @@ the rule that describes when a Tullia task is to be invoked.
Learn more: https://github.com/input-output-hk/cicero
*/

self: system:

let
ciInputName = "GitHub event";
repo = "input-output-hk/cardano-node";
repository = "input-output-hk/cardano-node";
in rec {
tasks = let
common = {
config,
...
}: {
mkTask = top: {config, lib, ...}: {
preset = {
# needed on top-level task to set runtime options
nix.enable = true;

github-ci = {
github.status = {
enable = config.actionRun.facts != {};
inherit repo;
sha = config.preset.github-ci.lib.getRevision ciInputName null;
clone.enable = false;
inherit repository;
revision = config.preset.github.lib.readRevision ciInputName null;
};
};

command.text = let
flakeUrl = ''github:${repository}/"$(${lib.escapeShellArg config.preset.github.status.revision})"'';
in config.preset.github.status.lib.reportBulk {
bulk.text = ''
echo '["x86_64-linux", "x86_64-darwin"]' | nix-systems -i \
| jq 'with_entries(.key |= {"x86_64-linux": "linux", "x86_64-darwin": "macos"}[.])'
'';
each.text = ''nix build -L ${flakeUrl}#${lib.escapeShellArg top}."$1".required'';
skippedDescription = lib.escapeShellArg "No nix builder available for this platform";
} + "\n" + ''
nix build -L ${flakeUrl}#${lib.escapeShellArg top}.cardano-deployment
'';

# some hydra jobs run NixOS tests
env.NIX_CONFIG = ''
extra-system-features = kvm
Expand All @@ -45,45 +51,19 @@ in rec {
memory = 1024 * 32;
nomad.resources.cpu = 10000;
};

# the attribute name in `hydraJobs` for the current system
os = {
x86_64-linux = "linux";
x86_64-darwin = "macos";
}.${system};

flakeUrl = {config, lib, ...}:
lib.escapeShellArg "github:${repo}/${config.preset.github-ci.lib.getRevision ciInputName null}";
in
{
"ci/push" = {lib, ...} @ args: {
imports = [common];

command.text = ''
nix build -L \
${flakeUrl args}#hydraJobs.${lib.escapeShellArg os}.required \
${flakeUrl args}#hydraJobs.cardano-deployment
'';
};

"ci/pr" = {lib, ...} @ args: {
imports = [common];

command.text = ''
nix build -L \
${flakeUrl args}#hydraJobsPr.${lib.escapeShellArg os}.required \
${flakeUrl args}#hydraJobsPr.cardano-deployment
'';
};
};
in {
"ci/push" = mkTask "hydraJobs";
"ci/pr" = mkTask "hydraJobsPr";
};

actions = {
"cardano-node/ci/push" = {
task = "ci/push";
io = ''
#lib.io.github_push
#input: "${ciInputName}"
#repo: "${repo}"
#repo: "${repository}"
#branch: "master|staging|trying"
'';
};

Expand All @@ -92,8 +72,7 @@ in rec {
io = ''
#lib.io.github_pr
#input: "${ciInputName}"
#repo: "${repo}"
#target_default: false
#repo: "${repository}"
'';
};
};
Expand Down

0 comments on commit 2225b10

Please sign in to comment.