about summary refs log tree commit diff stats
path: root/flake.nix
diff options
context:
space:
mode:
authorTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-09-10 10:29:10 +0000
committerTheofilos Augoustis <theofilos.augoustis@gmail.com>2025-09-10 10:29:10 +0000
commitb90c46e2777ffec89c1fdbd8ded150fcc9ed4084 (patch)
tree60348e73e4b3a08a89d374684561c6ed5654d82d /flake.nix
parentaafb69e4d91b79fa5a8a3c31dd1004edb66af0bd (diff)
downloadfocaccia-b90c46e2777ffec89c1fdbd8ded150fcc9ed4084.tar.gz
focaccia-b90c46e2777ffec89c1fdbd8ded150fcc9ed4084.zip
Add support for running tests with flake check
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index 8150a57..4141100 100644
--- a/flake.nix
+++ b/flake.nix
@@ -302,6 +302,28 @@
 				shellHook = uvShellHook;
 			};
 		};
+
+		checks = {
+			focaccia-tests = pkgs.stdenv.mkDerivation {
+				name = "focaccia-tests";
+				src = ./.;
+
+				doCheck = true;
+				dontBuild = true;
+
+				nativeCheckInputs = [ packages.dev pythonDevEnv ];
+
+				checkPhase = ''
+					set -euo pipefail
+					export REPO_ROOT="$PWD"
+					${packages.dev}/bin/python -m 'pytest' -q tests
+					touch $out
+				'';
+
+				env = uvEnv;
+				shellHook = uvShellHook;
+			};
+		};
 	});
 }