Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add cachix-action #319

Merged
merged 5 commits into from
Nov 2, 2023
Merged

ci: add cachix-action #319

merged 5 commits into from
Nov 2, 2023

Conversation

akirak
Copy link
Contributor

@akirak akirak commented Nov 1, 2023

This PR is a follow up to #312 and is intended to:

  • Save time on CI
  • Make the binaries immediately available to Nix users

by pushing newly built Nix assets to your cachix account.

As extra steps, you will have to:

@@ -128,4 +128,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: nixbuild/nix-quick-install-action@v26
- uses: cachix/cachix-action@v12
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably happen in the release workflow, so that it only caches new releases

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so that nix users are only getting stable releases, not a canary/nightly build, and I think this would also cache binaries for pull requests? I guess i'm not entirely sure how the cache works

Copy link
Contributor Author

@akirak akirak Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cachix offers a decent amount of storage space for free (10 GiB at present), but if you want that level of control, it may be a good idea to use magit-nix-cache-action for CI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on how this saves us CI time? we are using setup-beam for the elixir/erlang installation and already cache mix dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would save time on nix-build CI job I added in the previous PR. It's unnecessary if you don't intend to provide Nix packages from the flake. You are not using Nix to build the release assets, so the action would never accelerate your main workflow. Fro Nix, the action caches the Nix store, which saves time spent on rebuilding rebar3 with the latest Erlang every time.

@mhanberg mhanberg changed the title Add cachix-action ci: add cachix-action Nov 2, 2023
@mhanberg mhanberg force-pushed the cachix-action branch 2 times, most recently from e01aed9 to 47a5547 Compare November 2, 2023 03:05
@mhanberg mhanberg merged commit 3e0e14f into elixir-tools:main Nov 2, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants