mirror of
https://github.com/the-nix-way/dev-templates
synced 2024-05-29 15:06:13 +02:00
Add check action
This commit is contained in:
parent
9934d2686a
commit
2d373613e6
|
@ -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
|
|
@ -5,13 +5,14 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-22.04"
|
||||||
permissions:
|
permissions:
|
||||||
id-token: "write"
|
id-token: "write"
|
||||||
contents: "read"
|
contents: "read"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v3"
|
- uses: "actions/checkout@v4"
|
||||||
- uses: "DeterminateSystems/nix-installer-action@main"
|
- uses: "DeterminateSystems/nix-installer-action@main"
|
||||||
|
- uses: "DeterminateSystems/magic-nix-cache-action@main"
|
||||||
- uses: "DeterminateSystems/flakehub-push@main"
|
- uses: "DeterminateSystems/flakehub-push@main"
|
||||||
with:
|
with:
|
||||||
visibility: "public"
|
visibility: "public"
|
||||||
|
|
14
flake.nix
14
flake.nix
|
@ -15,6 +15,16 @@
|
||||||
${exec "nixpkgs-fmt"} **/*.nix
|
${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" ''
|
dvt = prev.writeScriptBin "dvt" ''
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
echo "no template specified"
|
echo "no template specified"
|
||||||
|
@ -46,8 +56,6 @@
|
||||||
nix flake check --all-systems --no-build
|
nix flake check --all-systems --no-build
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
@ -59,7 +67,7 @@
|
||||||
{
|
{
|
||||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
packages = with pkgs; [ format update ];
|
packages = with pkgs; [ check format update ];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue