1 import ./make-test-python.nix ({ pkgs, ... }:
3 name = "github-runner";
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ veehaitch ];
7 nodes.machine = { pkgs, ... }: {
8 services.github-runners.test = {
10 url = "https://github.com/yaxitech";
11 tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
14 systemd.services.dummy-github-com = {
15 wantedBy = [ "multi-user.target" ];
16 before = [ "github-runner-test.service" ];
17 script = "${pkgs.netcat}/bin/nc -Fl 443 | true && touch /tmp/registration-connect";
19 networking.hosts."127.0.0.1" = [ "api.github.com" ];
25 machine.wait_for_unit("dummy-github-com")
28 machine.wait_for_unit("github-runner-test")
32 out = machine.succeed("journalctl -u github-runner-test")
33 assert "Self-hosted runner registration" in out, "did not read runner registration header"
35 machine.wait_until_succeeds("test -f /tmp/registration-connect")