Skip to content

Commit

Permalink
Merge pull request #24 from kadena-io/rsoeldner/nix-tests
Browse files Browse the repository at this point in the history
run pact-core tests from nix build
  • Loading branch information
rsoeldner authored Oct 26, 2023
2 parents a5146ba + 63e296d commit 6759055
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- '**'
- '!.github/**'
- '.github/workflows/nix.yml'

jobs:
build-and-cache:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: [
Expand All @@ -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
'';
Expand Down

0 comments on commit 6759055

Please sign in to comment.