2024-11-30 19:34:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitea,
|
|
|
|
nixosTests,
|
|
|
|
versionCheckHook,
|
2023-07-20 19:36:21 +00:00
|
|
|
}:
|
|
|
|
|
2024-11-30 19:30:49 +00:00
|
|
|
let
|
|
|
|
# tests which assume network access in some form
|
|
|
|
disabledTests = [
|
|
|
|
"Test_runCreateRunnerFile"
|
|
|
|
"Test_ping"
|
|
|
|
];
|
|
|
|
in
|
2023-07-20 19:36:21 +00:00
|
|
|
buildGoModule rec {
|
2024-04-03 23:58:29 +00:00
|
|
|
pname = "forgejo-runner";
|
2024-11-30 19:27:10 +00:00
|
|
|
version = "5.0.3";
|
2023-07-20 19:36:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitea {
|
2023-12-24 14:19:30 +00:00
|
|
|
domain = "code.forgejo.org";
|
2023-07-20 19:36:21 +00:00
|
|
|
owner = "forgejo";
|
|
|
|
repo = "runner";
|
|
|
|
rev = "v${version}";
|
2024-11-30 19:27:10 +00:00
|
|
|
hash = "sha256-c1s2n4s2LY4KvQrPZJpAnXzJCTe6Fbc0cf1plwHZPiA=";
|
2023-07-20 19:36:21 +00:00
|
|
|
};
|
|
|
|
|
2024-11-30 19:27:10 +00:00
|
|
|
vendorHash = "sha256-DQcVknodbVlHygJkrGSfVGPKXR9kLGeyivNjYmjtFNs=";
|
2023-07-20 19:36:21 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X gitea.com/gitea/act_runner/internal/pkg/ver.version=${src.rev}"
|
|
|
|
];
|
|
|
|
|
2024-11-30 19:30:49 +00:00
|
|
|
checkFlags = [
|
|
|
|
"-skip ${lib.concatStringsSep "|" disabledTests}"
|
|
|
|
];
|
2023-07-20 19:36:21 +00:00
|
|
|
|
2024-11-30 19:34:02 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
|
|
versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}";
|
|
|
|
versionCheckProgramArg = [ "--version" ];
|
|
|
|
|
2024-04-10 15:52:52 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests.forgejo) sqlite3;
|
2023-07-20 19:36:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Runner for Forgejo based on act";
|
|
|
|
homepage = "https://code.forgejo.org/forgejo/runner";
|
2024-04-04 00:04:47 +00:00
|
|
|
changelog = "https://code.forgejo.org/forgejo/runner/src/tag/${src.rev}/RELEASE-NOTES.md";
|
2023-07-20 19:36:21 +00:00
|
|
|
license = licenses.mit;
|
2024-04-04 00:04:30 +00:00
|
|
|
maintainers = with maintainers; [ kranzes emilylange ];
|
2023-07-20 19:36:21 +00:00
|
|
|
mainProgram = "act_runner";
|
|
|
|
};
|
|
|
|
}
|