diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 3479450..0a62d11 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -18,20 +18,7 @@ jobs: # Prevent cache garbage collection by creating GC roots mkdir -p /var/lib/gitea-runner/tankstelle/.local/state/nix/results - for target in $(nix flake show --json --all-systems | jq --raw-output ' - .["nixosConfigurations"] | - to_entries[] | - .key' - ); do - nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \ - build --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/"$target" ".#nixosConfigurations.${target}.config.system.build.toplevel" - done - - for check in $(nix flake show --json --all-systems | jq --raw-output ' - .checks."x86_64-linux" | - to_entries[] | - .key' - ); do - nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \ - build --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/"$check" ".#checks.x86_64-linux.${check}" - done + sed -i 's/virtualisation.cores .*/virtualisation.cores = 16;/' tests/keycloak.nix + sed -i 's/virtualisation.memorySize .*/virtualisation.memorySize = 16384;/' tests/keycloak.nix + # 1 eval-worker needs about 13GB of memory + nix --accept-flake-config --access-tokens '' develop --command nix-fast-build --no-nom --skip-cached --systems "x86_64-linux" --max-jobs 10 --eval-workers 2 --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/nix-fast-build diff --git a/flake.nix b/flake.nix index 496599e..495eafa 100644 --- a/flake.nix +++ b/flake.nix @@ -78,6 +78,24 @@ checks = let + machinesPerSystem = { + aarch64-linux = [ + "metronom" + ]; + x86_64-linux = [ + "blue-shell" + "delite" + "nachtigall" + "tankstelle" + "trinkgenossin" + "underground" + ]; + }; + nixosMachines = inputs.nixpkgs.lib.mapAttrs' (n: inputs.nixpkgs.lib.nameValuePair "nixos-${n}") ( + inputs.nixpkgs.lib.genAttrs (machinesPerSystem.${system} or [ ]) ( + name: self.nixosConfigurations.${name}.config.system.build.toplevel + ) + ); nixos-lib = import (inputs.nixpkgs + "/nixos/lib") { }; testDir = builtins.attrNames (builtins.readDir ./tests); testFiles = builtins.filter (n: builtins.match "^.*.nix$" n != null) testDir; @@ -94,12 +112,13 @@ } ); }) testFiles - ); + ) + // nixosMachines; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ deploy-rs - nixpkgs-fmt + nix-fast-build agenix age-plugin-yubikey cachix diff --git a/tests/keycloak.nix b/tests/keycloak.nix index 9f5241b..0d4a825 100644 --- a/tests/keycloak.nix +++ b/tests/keycloak.nix @@ -46,6 +46,7 @@ in systemd.tmpfiles.rules = [ "f /tmp/dbf 1777 root root 10d password" ]; + virtualisation.cores = 1; virtualisation.memorySize = 4096; pub-solar-os.auth = { diff --git a/tests/website.nix b/tests/website.nix index 6d4f46d..db3a0aa 100644 --- a/tests/website.nix +++ b/tests/website.nix @@ -31,6 +31,7 @@ ./support/global.nix ]; + virtualisation.cores = 1; virtualisation.memorySize = 4096; networking.interfaces.eth0.ipv4.addresses = [