Skip to content

Commit

Permalink
Restore testing truncate-index
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabedini committed Aug 2, 2023
1 parent de39c2d commit bb663e8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,8 @@ jobs:
- uses: actions/checkout@v3
- name: "Check hix -- run github:haskell/cabal/3.10#cabal-install:exe:cabal -- --version"
run: "HIX_DIR=$(mktemp -d) nix run .#hix --accept-flake-config -- run github:haskell/cabal/3.10#cabal-install:exe:cabal --accept-flake-config --override-input haskellNix . -- --version"

nix-tools:
runs-on: [self-hosted, linux]
steps:
- run: nix build github:$GITHUB_REPOSITORY/$GITHUB_SHA#checks.truncate-index
23 changes: 20 additions & 3 deletions nix-tools/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
perSystem = lib.genAttrs systems f;
in
lib.genAttrs
[ "apps" "checks" "ciJobs" "devShells" "hydraJobs" "packages" ]
(attrName: lib.genAttrs systems (system: perSystem.${system}.${attrName} or {}))
[ "apps" "checks" "devShells" "hydraJobs" "packages" ]
(attrName: lib.genAttrs systems (system: perSystem.${system}.${attrName} or { }))
;
in
forEachSystem (system:
Expand Down Expand Up @@ -58,7 +58,8 @@
in
builtins.foldl' lib.recursiveUpdate { } [
{
inherit (project.flake') "checks" "ciJobs" "devShells" "hydraJobs";
inherit (project.flake') "checks" "devShells" "hydraJobs";

packages =
lib.mapAttrs'
(n: v: { name = v.exeName; value = v; })
Expand All @@ -74,6 +75,22 @@
hydraJobs.binary-tarball =
mkTarball project.projectCross.aarch64-multiplatform-musl.hsPkgs.nix-tools;
})
({
checks.truncate-index =
let
hash = "0z2jc4fibfxz88pfgjq3wk5j3v7sn34xkwb8h60hbwfwhhy63vx6";
index-state = "2020-01-10T00:00:00Z";
in
pkgs.runCommand "nix-tools-test-truncate-index"
{
outputHashAlgo = "sha256";
outputHash = hash;
buildInputs = [ pkgs.wget ];
} ''
wget http://hackage.haskell.org/01-index.tar.gz
${project.hsPkgs.nix-tools.components.exes.truncate-index}/bin/truncate-index -o $out -i 01-index.tar.gz -s ${index-state}
'';
})
]);

nixConfig = {
Expand Down
17 changes: 0 additions & 17 deletions nix-tools/test/truncate-index.nix

This file was deleted.

0 comments on commit bb663e8

Please sign in to comment.