readd mypy/pytest to checks

This commit is contained in:
Jörg Thalheim
2023-08-03 11:31:56 +02:00
parent 25b5f58866
commit e603ee6f49

View File

@@ -1,5 +1,5 @@
{ self, ... }: { { self, ... }: {
perSystem = { inputs', self', pkgs, ... }: { perSystem = { self', pkgs, ... }: {
devShells.clan = pkgs.callPackage ./shell.nix { devShells.clan = pkgs.callPackage ./shell.nix {
inherit self; inherit self;
inherit (self'.packages) clan; inherit (self'.packages) clan;
@@ -25,8 +25,9 @@
## End optional dependencies ## End optional dependencies
}; };
checks = self'.packages.clan.tests // {
# check if the `clan config` example jsonschema and data is valid # check if the `clan config` example jsonschema and data is valid
checks.clan-config-example-schema-valid = pkgs.runCommand "clan-config-example-schema-valid" { } '' clan-config-example-schema-valid = pkgs.runCommand "clan-config-example-schema-valid" { } ''
echo "Checking that example-schema.json is valid" echo "Checking that example-schema.json is valid"
${pkgs.check-jsonschema}/bin/check-jsonschema \ ${pkgs.check-jsonschema}/bin/check-jsonschema \
--check-metaschema ${./.}/tests/config/example-schema.json --check-metaschema ${./.}/tests/config/example-schema.json
@@ -40,12 +41,14 @@
''; '';
# check if the `clan config` nix jsonschema converter unit tests succeed # check if the `clan config` nix jsonschema converter unit tests succeed
checks.clan-config-nix-unit-tests = pkgs.runCommand "clan-edit-unit-tests" { } '' clan-config-nix-unit-tests = pkgs.runCommand "clan-edit-unit-tests" { } ''
export NIX_PATH=nixpkgs=${pkgs.path} export NIX_PATH=nixpkgs=${pkgs.path}
${inputs'.nix-unit.packages.nix-unit}/bin/nix-unit \ ${self'.packages.nix-unit}/bin/nix-unit \
${./.}/tests/config/test.nix \ ${./.}/tests/config/test.nix \
--eval-store $(realpath .) --eval-store $(realpath .)
touch $out touch $out
''; '';
}; };
};
} }