From 4288323a1b4f256c955675cb3d3c38dfd16216e4 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Wed, 28 May 2025 14:44:07 +0200 Subject: [PATCH] Test `push-to-cache` script --- .forgejo/workflows/build.yaml | 4 +++- checks/default.nix | 13 ++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index a2224c0..6edae8f 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -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 diff --git a/checks/default.nix b/checks/default.nix index ae2c491..57e0cd4 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -11,7 +11,7 @@ ]; perSystem = - { config, ... }: + { config, pkgs, ... }: { treefmt.config = { projectRootFile = ".git/config"; @@ -42,6 +42,17 @@ package = config.treefmt.build.wrapper; }; }; + packages.push-to-cache = + let + checks = with self.checks; x86_64-linux // aarch64-linux; + in + pkgs.writeShellScriptBin "push-to-cache.sh" '' + attic push $1 --stdin --jobs 4 << EOF + ${lib.concatStringsSep "\n" ( + builtins.map (builtins.unsafeDiscardStringContext) (builtins.attrValues checks) + )} + EOF + ''; }; flake.checks =