mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixos/tests/github-runner: init
This commit is contained in:
parent
137db83090
commit
e8df83d417
@ -243,6 +243,7 @@ in {
|
|||||||
ghostunnel = handleTest ./ghostunnel.nix {};
|
ghostunnel = handleTest ./ghostunnel.nix {};
|
||||||
gitdaemon = handleTest ./gitdaemon.nix {};
|
gitdaemon = handleTest ./gitdaemon.nix {};
|
||||||
gitea = handleTest ./gitea.nix { giteaPackage = pkgs.gitea; };
|
gitea = handleTest ./gitea.nix { giteaPackage = pkgs.gitea; };
|
||||||
|
github-runner = handleTest ./github-runner.nix {};
|
||||||
gitlab = handleTest ./gitlab.nix {};
|
gitlab = handleTest ./gitlab.nix {};
|
||||||
gitolite = handleTest ./gitolite.nix {};
|
gitolite = handleTest ./gitolite.nix {};
|
||||||
gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix {};
|
gitolite-fcgiwrap = handleTest ./gitolite-fcgiwrap.nix {};
|
||||||
|
37
nixos/tests/github-runner.nix
Normal file
37
nixos/tests/github-runner.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import ./make-test-python.nix ({ pkgs, ... }:
|
||||||
|
{
|
||||||
|
name = "github-runner";
|
||||||
|
meta = with pkgs.lib.maintainers; {
|
||||||
|
maintainers = [ veehaitch ];
|
||||||
|
};
|
||||||
|
nodes.machine = { pkgs, ... }: {
|
||||||
|
services.github-runners.test = {
|
||||||
|
enable = true;
|
||||||
|
url = "https://github.com/yaxitech";
|
||||||
|
tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.dummy-github-com = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
before = [ "github-runner-test.service" ];
|
||||||
|
script = "${pkgs.netcat}/bin/nc -Fl 443 | true && touch /tmp/registration-connect";
|
||||||
|
};
|
||||||
|
networking.hosts."127.0.0.1" = [ "api.github.com" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
|
||||||
|
machine.wait_for_unit("dummy-github-com")
|
||||||
|
|
||||||
|
try:
|
||||||
|
machine.wait_for_unit("github-runner-test")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
out = machine.succeed("journalctl -u github-runner-test")
|
||||||
|
assert "Self-hosted runner registration" in out, "did not read runner registration header"
|
||||||
|
|
||||||
|
machine.wait_until_succeeds("test -f /tmp/registration-connect")
|
||||||
|
'';
|
||||||
|
})
|
@ -8,6 +8,7 @@
|
|||||||
, glibc
|
, glibc
|
||||||
, glibcLocales
|
, glibcLocales
|
||||||
, lib
|
, lib
|
||||||
|
, nixosTests
|
||||||
, nodejs-16_x
|
, nodejs-16_x
|
||||||
, stdenv
|
, stdenv
|
||||||
, which
|
, which
|
||||||
@ -250,7 +251,10 @@ buildDotnetModule rec {
|
|||||||
runHook postInstallCheck
|
runHook postInstallCheck
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = ./update.sh;
|
passthru = {
|
||||||
|
tests.smoke-test = nixosTests.github-runner;
|
||||||
|
updateScript = ./update.sh;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
changelog = "https://github.com/actions/runner/releases/tag/v${version}";
|
changelog = "https://github.com/actions/runner/releases/tag/v${version}";
|
||||||
|
Loading…
Reference in New Issue
Block a user