cachix-action: Should not run `nix-build` unconditionally

I’d like to be able to use cachix-action when testing a non-Nix project, but it appears to run nix-build unconditionally. Ideally, IMO, the action should install cachix and enable the named cache, but should not assume that the current project is to be built.

https://github.com/purcell/package-lint/blob/nix-actions/.github/workflows/test.yml

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Could you try with:

- uses: cachix/cachix-action@releases/v3
      with:
        name: mycache
        skipNixBuild: true

I also have a use for this if I understand correctly. I nix-install a few things and then run some tests in a shell script with emacs my small (for now) repo.

Since nix-build is called I get an error, but I’m imagining there’s a way to just call my shell script in a nix expression that would make this work okay.

I was thinking to split it up, but then the maintenance cost is way too high. There’s also a penalty fetching actions at each build, so having mode seems like a good compromise. I’m not too happy about configure value, but can’t think of anything better.

Understood. I don’t think there’d be more than two modes, so why not just have build: false, to override the default of true? In the meantime, for my use case in an action I wrote, I’ve inlined the cachix installation and cachix use invocation.