Test push-to-cache script
Some checks failed
/ test (push) Has been cancelled

This commit is contained in:
Andrea Ciceri 2025-05-28 14:44:07 +02:00
parent 6bdf2e95c1
commit 197463cc08
No known key found for this signature in database
2 changed files with 19 additions and 3 deletions

View file

@ -16,6 +16,8 @@ jobs:
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Build with nix (x86_64-linux)
run: nix-fast-build --no-nom --systems "x86_64-linux aarch64-linux" --attic-cache "nixfleet" --skip-cached --result-file result.json || true
run: nix-fast-build --no-nom --systems "x86_64-linux aarch64-linux" --skip-cached --result-file result.json || true
- name: Push to cache
run: nix run .#push-to-cache -- nixfleet
- name: Report checks
run: report-checks

View file

@ -11,7 +11,7 @@
];
perSystem =
{ config, ... }:
{ config, pkgs, ... }:
{
treefmt.config = {
projectRootFile = ".git/config";
@ -42,6 +42,18 @@
package = config.treefmt.build.wrapper;
};
};
packages.push-to-cache =
let
allChecks = with self.checks; x86_64-linux // aarch64-linux;
checks = builtins.removeAttrs allChecks [ "push-to-cache" ];
in
pkgs.writeShellScriptBin "push-to-cache.sh" ''
attic push $1 --stdin --jobs 64 << EOF
${lib.concatStringsSep "\n" (
builtins.map (builtins.unsafeDiscardStringContext) (builtins.attrValues checks)
)}
EOF
'';
};
flake.checks =
@ -49,7 +61,9 @@
build = _: nc: nc.config.system.build.toplevel;
in
{
x86_64-linux = lib.mapAttrs build { inherit (self.nixosConfigurations) picard pike kirk; };
x86_64-linux = (lib.mapAttrs build { inherit (self.nixosConfigurations) picard pike kirk; }) // {
inherit (self.checks.x86_64-linux) push-to-cache;
};
aarch64-linux = lib.mapAttrs build {
inherit (self.nixosConfigurations) sisko; # pbp;
};