feat: maybe move to full github actions jobs instead of tasks

This commit is contained in:
Kat Inskip 2024-07-13 14:02:45 -07:00
parent 9d219f6d63
commit 9fcd2510a0
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
5 changed files with 93 additions and 241 deletions

View file

@ -9,11 +9,34 @@ with lib; {
imports = [ ./common.nix ];
config = {
name = "nodes";
gh-actions = {
env = {
CACHIX_SIGNING_KEY = "\${{ secrets.CACHIX_SIGNING_KEY }}";
DISCORD_WEBHOOK_LINK = "\${{ secrets.DISCORD_WEBHOOK_LINK }}";
};
on = let
paths = [
"*"
/*
"default.nix"
"ci/.nix"
config.ci.gh-actions.path
*/
];
in {
push = {
inherit paths;
};
pull_request = {
inherit paths;
};
workflow_dispatch = {};
};
jobs = let
enabledNixOSSystems = filterAttrs (_: system: system.config.ci.enable) channels.nixfiles.systems;
mkNixOSSystemJob = name: system: nameValuePair "${name}" {
step.build-system-wrapper = {
step.${name} = {
name = "Build ${name} system closure";
order = 500;
run = "nix run .#nf-build-system -- nixosConfigurations.${name}.config.system.build.topLevel ${name} NixOS";
@ -25,18 +48,18 @@ with lib; {
NF_CONFIG_ROOT = "\${{ github.workspace }}";
};
};
tasks = {
system = {
inputs = channels.nixfiles.nixosConfigurations.${name}.config.system.build.toplevel;
warn = system.config.ci.allowFailure;
};
};
};
nixOSSystemJobs = mapAttrs' mkNixOSSystemJob enabledNixOSSystems;
in {
in nixOSSystemJobs;
};
jobs = {
packages = { ... }: {
imports = [ ./packages.nix ];
};
} // nixOSSystemJobs;
};
ci.gh-actions.checkoutOptions = {
fetch-depth = 0;
};
};
}