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: allow jobs to install tools from pinned nixpkgs #2605

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

malt3
Copy link
Contributor

@malt3 malt3 commented Nov 15, 2023

Context

We often need additional tools in GitHub Actions Workflow jobs. This extension to the setup_bazel_nix action adds a new parameter nixTools which (if provided) will install a list of tools for the duration of the job and add their store paths to the GITHUB_PATH env.

Proposed change(s)

  • ci: allow jobs to install tools from pinned nixpkgs

Additional info

  • test run (prints cowsay and ponysay output)

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

Copy link

netlify bot commented Nov 15, 2023

Deploy Preview for constellation-docs canceled.

Name Link
🔨 Latest commit f419cb2
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/6556171fccacf40008b4dcf2

@malt3 malt3 force-pushed the feat/ci/nix-tools-in-actions branch from 03deb2c to 79de41b Compare November 15, 2023 19:57
@malt3 malt3 modified the milestone: v2.13.0 Nov 15, 2023
@malt3 malt3 marked this pull request as ready for review November 15, 2023 22:04
@malt3 malt3 requested review from katexochen and msanft November 16, 2023 07:26
@malt3
Copy link
Contributor Author

malt3 commented Nov 16, 2023

@miampf FYI. This enables you to install tools like zip by specifying:

nixTools: |
  zip

@msanft
Copy link
Contributor

msanft commented Nov 16, 2023

This would require us to add the tools in the top-level workflow where the setup_bazel_nix action is first called, right. This might add some duplication throughout multiple workflows that all call the same action that requires a specific tool. But I'm not sure yet how to circumvent that the best way.

Copy link
Contributor

@msanft msanft left a comment

Choose a reason for hiding this comment

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

Other than my above comment, changes LGTM

@malt3
Copy link
Contributor Author

malt3 commented Nov 16, 2023

This would require us to add the tools in the top-level workflow where the setup_bazel_nix action is first called, right. This might add some duplication throughout multiple workflows that all call the same action that requires a specific tool. But I'm not sure yet how to circumvent that the best way.

Agreed. This is not ideal but probably a good enough approximation. Ideally, any bash scripts used in the CI would be built and run using nix directly and would explicitly list direct dependencies.
Let’s go with this solution until we have a better idea.

@msanft msanft mentioned this pull request Nov 16, 2023
2 tasks
@malt3 malt3 force-pushed the feat/ci/nix-tools-in-actions branch 2 times, most recently from 2181361 to 2a94368 Compare November 16, 2023 12:53
@malt3 malt3 force-pushed the feat/ci/nix-tools-in-actions branch 2 times, most recently from be78dbb to 102bbb8 Compare November 16, 2023 13:03
@malt3 malt3 force-pushed the feat/ci/nix-tools-in-actions branch 2 times, most recently from 878275d to f419cb2 Compare November 16, 2023 13:20
@malt3 malt3 merged commit ac8aac0 into main Nov 16, 2023
4 checks passed
@malt3 malt3 deleted the feat/ci/nix-tools-in-actions branch November 16, 2023 13:41
@malt3 malt3 added the no changelog Change won't be listed in release changelog label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Change won't be listed in release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants