Skip to content

Commit

Permalink
Inlude tests within the derivation check phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanificient committed May 5, 2024
1 parent ee19c92 commit 3f95d5a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable

- run: nix build
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable

- run: nix develop -c zig build test
lint:
runs-on: ubuntu-latest
steps:
Expand Down
40 changes: 23 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,34 @@
];
};

packages.default = pkgs.stdenv.mkDerivation {
name = "Zaytracer";
src = ./.;
packages.default =
pkgs.stdenv.mkDerivation {
name = "Zaytracer";
src = ./.;

XDG_CACHE_HOME = "${placeholder "out"}";
XDG_CACHE_HOME = "${placeholder "out"}";

prePatch = ''
mkdir -p libs
prePatch = ''
mkdir -p libs
cp -r ${zig-gamedev} libs/zgamedev
'';
cp -r ${zig-gamedev} libs/zgamedev
'';

buildInputs = [ pkgs.raylib ];
buildPhase = ''
${pkgs.zig_0_12}/bin/zig build -Doptimize=ReleaseFast
'';
buildInputs = [ pkgs.raylib ];
nativeBuildInputs = [ pkgs.zig_0_12 ];
buildPhase = ''
zig build -Doptimize=ReleaseFast
'';

installPhase = ''
${pkgs.zig_0_12}/bin/zig build install --prefix $out -Doptimize=ReleaseFast
rm -rf $out/zig # remove cache
'';
doCheck = true;
checkPhase = ''
zig build test --summary all
'';

};
installPhase = ''
zig build install --prefix $out -Doptimize=ReleaseFast
rm -rf $out/zig # remove cache
'';
};
});
}

0 comments on commit 3f95d5a

Please sign in to comment.