-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add a new workflow that tries to automatically update nix hashes (#…
…2871) Usually, when we upgrade some dependencies, we have to manually update the hashes. This involves * changing the hash to something else (e.g. changing one character) * running the build locally * observing the error message with the actual hash * pasting that * commit and push. The `nix-update` tool can automate that. This PR makes Github do that on all pushes (even to feature branches), and if needed, push a fix to that branch. With #2761 adding even more fixed output derivations, this may be more relevant.
- Loading branch information
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Update nix hashes | ||
|
||
on: | ||
push: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
jobs: | ||
update-hash: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# This is needed to be able to push and trigger CI with that push | ||
token: ${{ secrets.NIV_UPDATER_TOKEN }} | ||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-21.11 | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: ic-hs-test | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- name: Update drun cargo hash | ||
run: | | ||
cd nix | ||
nix --extra-experimental-features nix-command shell -f . nix-update -c nix-update --version=skip drun | ||
- name: Commit changes | ||
uses: EndBug/[email protected] | ||
with: | ||
author_name: Nix hash updater | ||
author_email: "<[email protected]>" | ||
message: "Updating nix hashes" | ||
# do not pull: if this branch is behind, then we might as well let | ||
# the pushing fail | ||
pull: "NO-PULL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@nomeata Turns out this should only be active for non-protected branches. I.e.
Update nix hashes
should not run on tag pushes and pushes tomaster
.