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:
parent
9dc02e94f7
commit
48f8a53415
|
@ -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:
|
||||
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"
|
||||
|
|
14
flake.nix
14
flake.nix
|
@ -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 ];
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue