Add flake-check (#7)
Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk> Reviewed-on: #7
This commit is contained in:
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,4 +1,3 @@
|
|||||||
* text=auto
|
* text=auto
|
||||||
*.sh text eol=lf
|
* text eol=lf
|
||||||
*.nix text eol=lf
|
|
||||||
hooks/pre-push text eol=lf
|
hooks/pre-push text eol=lf
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,3 +10,6 @@ riderModule.iml
|
|||||||
test.sqlite
|
test.sqlite
|
||||||
__pycache__/
|
__pycache__/
|
||||||
.idea
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
/result
|
||||||
|
@@ -4,7 +4,7 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
- echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
|
||||||
# Lint
|
# Lint
|
||||||
image: nixos/nix
|
- "nix flake check"
|
||||||
- "nix develop --command bash -c 'dotnet tool restore && ./hooks/pre-push'"
|
- "nix develop --command bash -c 'dotnet tool restore && ./hooks/pre-push'"
|
||||||
# Test
|
# Test
|
||||||
- nix build
|
- nix build
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
|
25
flake.nix
25
flake.nix
@@ -39,9 +39,10 @@
|
|||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
fantomas = dotnetTool "fantomas" (builtins.fromJSON (builtins.readFile ./.config/dotnet-tools.json)).tools.fantomas.version "sha256-83RodORaC3rkYfbFMHsYLEtl0+8+akZXcKoSJdgwuUo=";
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
fantomas = dotnetTool "fantomas" (builtins.fromJSON (builtins.readFile ./.config/dotnet-tools.json)).tools.fantomas.version "sha256-83RodORaC3rkYfbFMHsYLEtl0+8+akZXcKoSJdgwuUo=";
|
fantomas = fantomas;
|
||||||
fetchDeps = let
|
fetchDeps = let
|
||||||
flags = [];
|
flags = [];
|
||||||
runtimeIds = ["win-x64"] ++ map (system: pkgs.dotnetCorePackages.systemToDotnetRid system) dotnet-sdk.meta.platforms;
|
runtimeIds = ["win-x64"] ++ map (system: pkgs.dotnetCorePackages.systemToDotnetRid system) dotnet-sdk.meta.platforms;
|
||||||
@@ -87,5 +88,27 @@
|
|||||||
else []
|
else []
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
checks = {
|
||||||
|
fantomas = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "fantomas-check";
|
||||||
|
src = ./.;
|
||||||
|
checkPhase = ''
|
||||||
|
${fantomas}/bin/fantomas --check .
|
||||||
|
'';
|
||||||
|
installPhase = "mkdir $out";
|
||||||
|
dontBuild = true;
|
||||||
|
doCheck = true;
|
||||||
|
};
|
||||||
|
verify = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "verify-schema";
|
||||||
|
src = ./.;
|
||||||
|
checkPhase = ''
|
||||||
|
${self.packages.${system}.default}/bin/AnkiStatic verify AnkiStatic.Test/CapitalsOfTheWorld.json
|
||||||
|
'';
|
||||||
|
installPhase = "mkdir $out";
|
||||||
|
dontBuild = true;
|
||||||
|
doCheck = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user