nixpkgs/pkgs/by-name/fo/forgejo-runner/package.nix
Christoph Heiss e41fbfb280
forgejo-runner: use versionCheckHook for program version check
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-11-30 20:34:02 +01:00

58 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitea,
nixosTests,
versionCheckHook,
}:
let
# tests which assume network access in some form
disabledTests = [
"Test_runCreateRunnerFile"
"Test_ping"
];
in
buildGoModule rec {
pname = "forgejo-runner";
version = "5.0.3";
src = fetchFromGitea {
domain = "code.forgejo.org";
owner = "forgejo";
repo = "runner";
rev = "v${version}";
hash = "sha256-c1s2n4s2LY4KvQrPZJpAnXzJCTe6Fbc0cf1plwHZPiA=";
};
vendorHash = "sha256-DQcVknodbVlHygJkrGSfVGPKXR9kLGeyivNjYmjtFNs=";
ldflags = [
"-s"
"-w"
"-X gitea.com/gitea/act_runner/internal/pkg/ver.version=${src.rev}"
];
checkFlags = [
"-skip ${lib.concatStringsSep "|" disabledTests}"
];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}";
versionCheckProgramArg = [ "--version" ];
passthru.tests = {
inherit (nixosTests.forgejo) sqlite3;
};
meta = with lib; {
description = "Runner for Forgejo based on act";
homepage = "https://code.forgejo.org/forgejo/runner";
changelog = "https://code.forgejo.org/forgejo/runner/src/tag/${src.rev}/RELEASE-NOTES.md";
license = licenses.mit;
maintainers = with maintainers; [ kranzes emilylange ];
mainProgram = "act_runner";
};
}