From febf43b1d04c12754170c9261923dc26c6bdc550 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Thu, 2 May 2024 11:16:31 -0700 Subject: [PATCH] feat(ci): cache deploy-rs --- .github/workflows/nodes.yml | 51 +++++++++++++++++++++++++++++++++++++ ci/nodes.nix | 13 +++++++--- packages/default.nix | 5 ---- 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nodes.yml b/.github/workflows/nodes.yml index 8b09d2d4..87d075c8 100644 --- a/.github/workflows/nodes.yml +++ b/.github/workflows/nodes.yml @@ -130,6 +130,57 @@ jobs: command: ci-build-cache quiet: false stdin: ${{ runner.temp }}/ci.build.cache + deploy-rs: + name: nodes-deploy-rs + runs-on: ubuntu-latest + steps: + - id: checkout + name: git clone + uses: actions/checkout@v4 + with: + submodules: false + - id: nix-install + name: nix install + uses: arcnmx/ci/actions/nix/install@v0.7 + - id: ci-dirty + name: nix test dirty + uses: arcnmx/ci/actions/nix/run@v0.7 + with: + attrs: ci.job.deploy-rs.run.test + command: ci-build-dirty + quiet: false + stdout: ${{ runner.temp }}/ci.build.dirty + - id: ci-test + name: nix test build + uses: arcnmx/ci/actions/nix/run@v0.7 + with: + attrs: ci.job.deploy-rs.run.test + command: ci-build-realise + ignore-exit-code: true + quiet: false + stdin: ${{ runner.temp }}/ci.build.dirty + - env: + CI_EXIT_CODE: ${{ steps.ci-test.outputs.exit-code }} + id: ci-summary + name: nix test results + uses: arcnmx/ci/actions/nix/run@v0.7 + with: + attrs: ci.job.deploy-rs.run.test + command: ci-build-summarise + quiet: false + stdin: ${{ runner.temp }}/ci.build.dirty + stdout: ${{ runner.temp }}/ci.build.cache + - env: + CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }} + id: ci-cache + if: always() + name: nix test cache + uses: arcnmx/ci/actions/nix/run@v0.7 + with: + attrs: ci.job.deploy-rs.run.test + command: ci-build-cache + quiet: false + stdin: ${{ runner.temp }}/ci.build.cache extern-test: name: nodes-extern-test runs-on: ubuntu-latest diff --git a/ci/nodes.nix b/ci/nodes.nix index abc4a7bb..5e803243 100644 --- a/ci/nodes.nix +++ b/ci/nodes.nix @@ -25,13 +25,20 @@ with lib; { jobs = let enabledSystems = filterAttrs (_: system: system.config.ci.enable) channels.nixfiles.lib.systems; - in - mapAttrs' (name: system: nameValuePair "${name}" { + mkSystemJob = name: system: nameValuePair "${name}" { tasks.system = { inputs = channels.nixfiles.nixosConfigurations.${name}.config.system.build.toplevel; warn = system.config.ci.allowFailure; }; - }) enabledSystems; + }; + systemJobs = mapAttrs' mkSystemJob enabledSystems; + in { + deploy-rs = { + tasks.binary = { + inputs = channels.nixfiles.packages.x86_64-linux.deploy-rs; + }; + }; + } // systemJobs; ci.gh-actions.checkoutOptions.submodules = false; cache.cachix.arc = { diff --git a/packages/default.nix b/packages/default.nix index 7ed28dd7..041e9bc0 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -44,11 +44,6 @@ inherit (pkgs) freeipa-ipasam samba-ldap samba-ipa; - nf-deploy = pkgs.writeShellScriptBin "nf-deploy" '' - ${exports} - ${exportsSsh} - exec ${pkgs.runtimeShell} ${../ci/deploy.sh} "$@" - ''; nf-setup-node = let reisen = ../systems/reisen; inherit (inputs.self.lib.lib) userIs;