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

simplify changing cachix cache for install tests #4577

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

abathur
Copy link
Member

@abathur abathur commented Feb 25, 2021

@domenkozar In the process of getting set up to try out the new installer tests that landed in #4549 I noticed a couple of small workflow improvements:

  • Make cachix cache name deterministic to avoid workflow friction (having to re-make this change every time, remember to take it back out before merge or test it on a separate branch, etc.)
    • I wanted to make this a secret to make it easily configurable, but GA apparently won't allow an output (i.e., the installerURL) to have a secret in it.
    • Instead I'm using lowercase<username>-<repo>-install-tests (i.e., abathur-nix-install-tests)
  • Set CACHIX_AUTH_TOKEN in addition to CACHIX_SIGNING_KEY so that both methods are supported. It looks like cachix will try signing key first, then auth token.

Test runs in my fork for this change:

If adopted, Nix would need a new nixos-nix-install-tests cache.

@abathur abathur marked this pull request as draft February 25, 2021 23:54
@abathur abathur force-pushed the simplify_install_tests branch 13 times, most recently from 1004a09 to ef75aa0 Compare February 26, 2021 22:13
- convert cachix cache name from an env into a secret so it (along
  with the token/key) can be set once per fork
- use CACHIX_AUTH_TOKEN in addition to CACHIX_SIGNING_KEY; it looks
  like cachix will try signing key first, then auth token.
@abathur
Copy link
Member Author

abathur commented Feb 26, 2021

@domenkozar I've modified this after the initial plan didn't quite work out.

I wanted to just move the CACHIX_NAME into the repo secrets so that it'd be easy to set once per fork, but I didn't realize GA would literally prevent it from appearing in the output of a step (which breaks the installerURL).

I still think there's ergonomic value in something lower-friction than having to modify the workflow, so I've fallen back on a deterministic CACHIX_NAME (lowercase of <username>-<repo>-install-tests) so the user can just create the matching cache and add a token/key for it to the repo's secrets. I also figured out how to keep these from trying to run if the secret isn't set. (links to runs in OP)

@abathur abathur marked this pull request as ready for review February 26, 2021 23:43
@domenkozar domenkozar merged commit 8127094 into NixOS:master Mar 11, 2021
@domenkozar
Copy link
Member

Seems to work! https://github.com/NixOS/nix/runs/2087652478

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152/1

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/installer-test-suite-small-project-s-high-leverage-help-wanted/13662/1

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.

3 participants