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 services.github-runners.test-disabled = {
16 url = "https://github.com/yaxitech";
17 tokenFile = builtins.toFile "github-runner.token" "not-so-secret";
20 systemd.services.dummy-github-com = {
21 wantedBy = [ "multi-user.target" ];
22 before = [ "github-runner-test.service" ];
23 script = "${pkgs.netcat}/bin/nc -Fl 443 | true && touch /tmp/registration-connect";
25 networking.hosts."127.0.0.1" = [ "api.github.com" ];
31 machine.wait_for_unit("dummy-github-com")
34 machine.wait_for_unit("github-runner-test")
38 out = machine.succeed("journalctl -u github-runner-test")
39 assert "Self-hosted runner registration" in out, "did not read runner registration header"
41 machine.wait_until_succeeds("test -f /tmp/registration-connect")
43 machine.fail("systemctl list-unit-files | grep test-disabled")