Skip to content

Commit

Permalink
ci: update Nix installation action
Browse files Browse the repository at this point in the history
update Nix installation action to v25 and configure trusted keys
and substituters for improved caching and security.
  • Loading branch information
YusukeShimizu committed Jun 30, 2024
1 parent 10579a4 commit b22e3d6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 30 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,12 @@ jobs:
key: nix-${{ hashFiles('packages.nix') }}

- name: Install Nix
uses: cachix/install-nix-action@v20
uses: actions/checkout@v3
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: "Import Nix store cache"
if: "steps.nix-cache.outputs.cache-hit == 'true'"
run: "nix-store --import < /tmp/nixcache"

- name: "Export Nix store cache"
if: "steps.nix-cache.outputs.cache-hit != 'true'"
run: "nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache"

- name: Run tests
extra_nix_config: |
trusted-public-keys = nix.casatta.it:HseKZh7436/vKXfZDBHbhr7wwAkzjLwY5BIq+OOrITg= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://nix.casatta.it https://cache.nixos.org/
- uses: DeterminateSystems/magic-nix-cache-action@v2
- name: "test"
run: nix develop --command make test-${{matrix.test-vector}}
30 changes: 15 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,41 @@
# blockstream-electrs: init at 0.4.1 #299761
# https://github.com/NixOS/nixpkgs/pull/299761/commits/680d27ad847801af781e0a99e4b87ed73965c69a
nixpkgs2.url = "github:NixOS/nixpkgs/680d27ad847801af781e0a99e4b87ed73965c69a";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
crane = {
url = "github:ipetkov/crane";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
# lwk: init at wasm_0.6.3 #14bac28
# https://github.com/Blockstream/lwk/releases/tag/wasm_0.6.3
lwk-flake = {
url = "github:blockstream/lwk/14bac284fe712dd6fdbbbe82bda179a2a236b2fa";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
crane.follows = "crane";
rust-overlay.follows = "rust-overlay";
};
};
};
outputs = { self, nixpkgs, nixpkgs2, flake-utils, lwk-flake }:
outputs = { self, nixpkgs, nixpkgs2, rust-overlay, crane, flake-utils, lwk-flake }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
system = system;
inherit system overlays;
};
pkgs2 = import nixpkgs2 {
system = system;
inherit system overlays;
};
blockstream-electrs = pkgs2.blockstream-electrs.overrideAttrs (oldAttrs: {
cargoBuildFlags = [ "--features liquid" "--bin electrs" ];
Expand Down

0 comments on commit b22e3d6

Please sign in to comment.