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 a new workflow that tries to automatically update nix hashes #2871

Merged
merged 26 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/update-hash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update nix hashes

on:
push:

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"
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ rec {
nixpkgs.ocamlPackages.utop
nixpkgs.fswatch
nixpkgs.niv
nixpkgs.nix-update
nixpkgs.rlwrap # for `rlwrap moc`
]
));
Expand Down
9 changes: 5 additions & 4 deletions nix/drun.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ pkgs:
# 2. run nix-build -A drun nix/
# 3. copy the “expected” hash from the output into this file
# 4. commit and push
#
# To automate this, .github/workflows/update-hash.yml has been
# installed. You will normally not be bothered to perform
# the command therein manually.

# To automate this, try running the following in the nix/ directory
# nix run -f https://github.com/Mic92/nix-update/archive/master.tar.gz -c nix-update --version=skip drun

cargoSha256 = "sha256:1m2a12ds4bpg3v0wfn4svcplr68118vcdzs5mvll6s71j9bpgqli";
cargoSha256 = "sha256-keJ3V5LhaEPprkX/xjYKAZlML9uaWMfBHu8uopsIStQ=";

nativeBuildInputs = with pkgs; [
pkg-config
Expand Down