feat(reuse): Switch to an action rather than a git hook, to be less cumbersome #262
3 changed files with 42 additions and 6 deletions
13
.forgejo/workflows/reuse-check.yaml
Normal file
13
.forgejo/workflows/reuse-check.yaml
Normal file
|
@ -0,0 +1,13 @@
|
|||
###
|
||||
# This file was automatically generated with nix-actions.
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: nix
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: REUSE lint
|
||||
run: nix-shell -A reuse-check --run 'reuse lint'
|
||||
name: REUSE lint
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
|
@ -44,12 +44,6 @@ let
|
|||
package = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
|
||||
reuse = nix-reuse.hook {
|
||||
enable = true;
|
||||
stages = [ "pre-push" ];
|
||||
package = pkgs.reuse; # git-hooks.nix is lagging on nixpkgs update
|
||||
};
|
||||
|
||||
commitizen.enable = true;
|
||||
};
|
||||
};
|
||||
|
@ -185,6 +179,7 @@ in
|
|||
src = sources.nixos-generators;
|
||||
}))
|
||||
pkgs.npins
|
||||
pkgs.reuse
|
||||
|
||||
# SSO testing
|
||||
pkgs.kanidm
|
||||
|
@ -216,6 +211,7 @@ in
|
|||
check-workflows.shellHook = workflows.shellHook;
|
||||
eval-nodes.packages = [ scripts.cache-node ];
|
||||
eval-shell.packages = [ scripts.nix-build-and-cache ];
|
||||
reuse-check.packages = [ pkgs.reuse ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
27
workflows/reuse-check.nix
Normal file
27
workflows/reuse-check.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
{ nix-actions, ... }:
|
||||
|
||||
{
|
||||
name = "REUSE lint";
|
||||
on = [
|
||||
"push"
|
||||
"pull_request"
|
||||
];
|
||||
|
||||
jobs.pre-commit = {
|
||||
runs-on = "nix";
|
||||
steps = [
|
||||
{ uses = "actions/checkout@v3"; }
|
||||
{
|
||||
name = "REUSE lint";
|
||||
run = nix-actions.lib.nix-shell {
|
||||
script = "reuse lint";
|
||||
shell = "reuse-check";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue