From 63e296d32329349e36188fb70347363c779be560 Mon Sep 17 00:00:00 2001 From: rsoeldner Date: Tue, 24 Oct 2023 12:18:35 +0200 Subject: [PATCH] run pact-core tests from nix build --- .github/workflows/nix.yml | 4 ++-- flake.nix | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 108af0d7f..0b4a45bb2 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -7,7 +7,7 @@ on: - '**' - '!.github/**' - '.github/workflows/nix.yml' - + jobs: build-and-cache: runs-on: ${{ matrix.os }} @@ -35,7 +35,7 @@ jobs: - name: Give root user AWS credentials uses: kadena-io/setup-nix-with-cache/copy-root-aws-credentials@v3 - + - name: Build and cache artifacts run: | echo Building the project and its devShell diff --git a/flake.nix b/flake.nix index f2f30690d..96cee7d0a 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,8 @@ outputs = { self, nixpkgs, flake-utils, haskellNix }: flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" - "aarch64-linux" "aarch64-darwin" ] (system: + "aarch64-linux" "aarch64-darwin" + ] (system: let pkgs = import nixpkgs { inherit system overlays; @@ -44,8 +45,11 @@ echo ${name}: ${package} echo works > $out ''; - in flake // rec { - packages.default = flake.packages."pact-core:exe:repl"; + in pkgs.lib.recursiveUpdate flake rec { + packages.pact-core-binary = flake.packages."pact-core:exe:repl"; + packages.pact-core-tests = flake.packages."pact-core:test:core-tests"; + + packages.default = packages.pact-core-binary; devShell = pkgs.haskellPackages.shellFor { packages = p: [ @@ -59,7 +63,13 @@ withHoogle = true; }; packages.check = pkgs.runCommand "check" {} '' + export LANG=C.UTF-8 + echo ${mkCheck "pact-core" packages.default} + + echo ${packages.pact-core-tests} + (cd ${self}; ${packages.pact-core-tests}/bin/core-tests) + echo ${mkCheck "devShell" flake.devShell} echo works > $out '';