1
1
Fork 0
mirror of https://github.com/the-nix-way/dev-templates synced 2024-05-06 04:36:05 +02:00

Add check action

This commit is contained in:
Luc Perkins 2024-04-15 11:50:56 -03:00
parent 9dc02e94f7
commit 48f8a53415
No known key found for this signature in database
GPG Key ID: 16DB1108FB591835
3 changed files with 28 additions and 5 deletions

14
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,14 @@
on:
pull_request:
push:
branches: [main]
jobs:
check:
runs-on: "ubuntu-22.04"
steps:
- uses: "actions/checkout@v4"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/magic-nix-cache-action@main"
- name: Flake check
run: nix develop --command check

View File

@ -5,13 +5,14 @@ on:
jobs:
publish:
runs-on: "ubuntu-latest"
runs-on: "ubuntu-22.04"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/magic-nix-cache-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
visibility: "public"

View File

@ -15,6 +15,16 @@
${exec "nixpkgs-fmt"} **/*.nix
'';
check = prev.writeScriptBin "check" ''
for dir in `ls -d */`; do # Iterate through all the templates
(
cd $dir
nix flake check --all-systems --no-build
)
done
'';
dvt = prev.writeScriptBin "dvt" ''
if [ -z $1 ]; then
echo "no template specified"
@ -46,8 +56,6 @@
nix flake check --all-systems --no-build
)
done
'';
})
];
@ -59,7 +67,7 @@
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [ format update ];
packages = with pkgs; [ check format update ];
};
});