From 0a5a0a1d241161e5800e0689d095ba291d68925a Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Wed, 6 Nov 2024 14:49:12 -0500 Subject: [PATCH 1/2] ci: Use the new cachix-push leveraging omci.json --- .github/workflows/ci.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2134dbcc..9c89175c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -94,8 +94,16 @@ jobs: # Push the Nix cache - name: Push to cachix - if: github.ref == 'refs/heads/main' - run: nix --option system "${{ matrix.system }}" run .#cachix-push + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + if: env.BRANCH_NAME == 'main' + run: | + nix run github:juspay/cachix-push -- \ + --subflake omnix \ + --prefix "${BRANCH_NAME}" \ + --cache om \ + < $HOME/omci.json static-binary-check: needs: main From 30aee76aecca7a81ace9546b760841215e963364 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 12 Nov 2024 16:51:12 -0500 Subject: [PATCH 2/2] Avoid clone when possible --- crates/omnix-ci/src/command/core.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/omnix-ci/src/command/core.rs b/crates/omnix-ci/src/command/core.rs index 7035838f..41e073ee 100644 --- a/crates/omnix-ci/src/command/core.rs +++ b/crates/omnix-ci/src/command/core.rs @@ -46,11 +46,11 @@ impl Command { } } - /// Get the flake ref associated with this subcommand - fn get_flake_ref(&self) -> FlakeRef { + /// Get the [FlakeRef] associated with this subcommand + fn get_flake_ref(&self) -> &FlakeRef { match self { - Command::Run(cmd) => cmd.flake_ref.clone(), - Command::DumpGithubActionsMatrix(cmd) => cmd.flake_ref.clone(), + Command::Run(cmd) => &cmd.flake_ref, + Command::DumpGithubActionsMatrix(cmd) => &cmd.flake_ref, } }