fix: Added phpstan flake check.

This commit is contained in:
Spencer Brower
2025-02-24 13:51:29 -05:00
parent d90143963c
commit 1fa4e327b5
2 changed files with 50 additions and 27 deletions

View File

@@ -4,7 +4,9 @@
outputs = { nixpkgs, self }: {
nixosModules = {
laravel = import ./nixos/modules/web-apps/laravel.nix;
vagrant = { ... }: { imports = [ ./nixos/modules/virtualisation/vagrant.nix ]; };
vagrant = { ... }: {
imports = [ ./nixos/modules/virtualisation/vagrant.nix ];
};
};
templates = {
@@ -14,16 +16,18 @@
};
nodejs = {
path = ./templates/nodejs;
description = "A simple boilerplate for running Node.js apps in a nix shell.";
description =
"A simple boilerplate for running Node.js apps in a nix shell.";
};
php = {
path = ./templates/php;
description = "A simple boilerplate for running PHP apps in a nix shell.";
description =
"A simple boilerplate for running PHP apps in a nix shell.";
};
};
checks."x86_64-linux".vagrant = let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
checks."x86_64-linux".vagrant =
let pkgs = nixpkgs.legacyPackages."x86_64-linux";
in pkgs.nixosTest {
name = "vagrant-box-test";
nodes.machine = { config, pkgs, ... }: {
@@ -35,7 +39,8 @@
message = "Laravel should be disabled";
}
{
assertion = config.services.laravel.bashAliases.enable == config.services.laravel.enable;
assertion = config.services.laravel.bashAliases.enable
== config.services.laravel.enable;
message = "Bash aliases should be enabled";
}
];

View File

@@ -134,6 +134,24 @@
vscode-langservers-extracted
];
};
checks = {
phpstan = pkgs.stdenvNoCC.mkDerivation {
name = "phpstan-check";
dontBuild = true;
doCheck = true;
src = ./.;
buildInputs = [ php php.packages.phpstan ];
checkPhase = ''
mkdir $out
cp -r $src/* $out
cd $out
php install.php
phpstan analyze --ansi # --memory-limit=256M
'';
};
};
};
};
}