add nixbased build ci
This commit is contained in:
33
default.nix
Normal file
33
default.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
# default.nix
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
pname = "RatChess";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
zig
|
||||
zls
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
echo "Building project..."
|
||||
${pkgs.zig}/bin/zig build --global-cache-dir ./cache --release=fast
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r zig-out/* $out/
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
echo "Testing project..."
|
||||
${pkgs.zig}/bin/zig build test --global-cache-dir ./cache
|
||||
'';
|
||||
doCheck = true;
|
||||
}
|
||||
Reference in New Issue
Block a user