update hydra for gitea
All checks were successful
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 10s
Check Nix formatting / Perform Nix format checks (pull_request) Successful in 3m32s
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Successful in 8m41s

This commit is contained in:
ahuston-0 2025-05-26 22:06:30 -04:00
parent a00d2ec853
commit 8d22f15781
No known key found for this signature in database
GPG Key ID: 47940175096C1330
2 changed files with 19 additions and 16 deletions

View File

@ -19,7 +19,6 @@ let
prs = readJSONFile pulls;
refs = readJSONFile branches;
repo = "RAD-Development/flake-update-diff";
# template for creating a job
makeJob =
@ -28,6 +27,7 @@ let
keepnr ? 3,
description,
flake,
enabled ? 1,
}:
{
inherit
@ -35,36 +35,39 @@ let
flake
schedulingshares
keepnr
enabled
;
enabled = 1;
type = 1;
hidden = false;
checkinterval = 300; # every 6 months
checkinterval = 300; # every 5 minutes
enableemail = false;
emailoverride = "";
};
# Create a hydra job for a branch
giteaHost = "ssh://gitea@nayeonie.com:2222";
repo = "ahuston-0/flake-update-diff";
# # Create a hydra job for a branch
jobOfRef =
name:
{ ref, ... }:
if (builtins.match "^refs/heads/(.*)$" ref) == null then
if ((builtins.match "^refs/heads/(.*)$" ref) == null) then
null
else
{
name = builtins.replaceStrings [ "/" ] [ "-" ] "branch-${name}";
value = makeJob {
description = "Branch ${name}";
flake = "git+ssh://git@github.com/${repo}?ref=${ref}";
flake = "git+${giteaHost}/${repo}?ref=${ref}";
};
};
# Create a hydra job for a PR
jobOfPR = id: info: {
name = "pr-${id}";
name = if info.draft then "draft-${id}" else "pr-${id}";
value = makeJob {
description = "PR ${id}: ${info.title}";
flake = "git+ssh://git@github.com/${info.head.repo.full_name}?ref=${info.head.ref}";
flake = "git+${giteaHost}/${repo}?ref=${info.head.ref}";
enabled = info.state == "open";
};
};
@ -74,7 +77,7 @@ let
# wrapper function for reading json from file
readJSONFile = f: builtins.fromJSON (builtins.readFile f);
# remove null values from a set, in-case of branches that don't exist
mapFilter = f: l: builtins.filter (x: x != null) (map f l);
mapFilter = f: l: builtins.filter (x: (x != null)) (map f l);
# Create job set from PRs and branches
jobs = makeSpec (

View File

@ -1,7 +1,7 @@
{
"enabled": 1,
"hidden": false,
"description": "Flake update diff tool",
"description": "Flake Update Diff Tool (flupdt)",
"nixexprinput": "nixexpr",
"nixexprpath": "hydra/jobsets.nix",
"checkinterval": 60,
@ -12,23 +12,23 @@
"type": 0,
"inputs": {
"nixexpr": {
"value": "https://github.com/RAD-Development/flake-update-diff main",
"value": "ssh://gitea@nayeonie.com:2222/ahuston-0/flake-update-diff.git main",
"type": "git",
"emailresponsible": false
},
"nixpkgs": {
"value": "https://github.com/NixOS/nixpkgs nixos-unstable-small",
"value": "https://github.com/NixOS/nixpkgs nixos-unstable",
"type": "git",
"emailresponsible": false
},
"pulls": {
"type": "githubpulls",
"value": "RAD-Development flake-update-diff",
"type": "giteapulls",
"value": "nayeonie.com ahuston-0 flake-update-diff https",
"emailresponsible": false
},
"branches": {
"type": "github_refs",
"value": "RAD-Development flake-update-diff heads -",
"type": "gitea_refs",
"value": "nayeonie.com ahuston-0 flake-update-diff heads https -",
"emailresponsible": false
}
}