2024-12-12 14:41:43 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2024-11-11 17:52:23 +01:00
|
|
|
{
|
|
|
|
name = "Run pre-commit on all files";
|
|
|
|
on = [
|
|
|
|
"push"
|
|
|
|
"pull_request"
|
|
|
|
];
|
|
|
|
|
2024-12-12 15:01:42 +01:00
|
|
|
jobs.pre-commit = {
|
2024-11-11 17:52:23 +01:00
|
|
|
runs-on = "nix";
|
2024-12-12 15:01:42 +01:00
|
|
|
steps =
|
|
|
|
[ { uses = "actions/checkout@v3"; } ]
|
|
|
|
++ (builtins.map
|
|
|
|
(stage: {
|
|
|
|
name = "Check stage ${stage}";
|
|
|
|
run = "nix-shell -A pre-commit --run 'pre-commit run --all-files --hook-stage ${stage} --show-diff-on-failure'";
|
|
|
|
})
|
|
|
|
[
|
|
|
|
"pre-commit"
|
|
|
|
"pre-push"
|
|
|
|
]
|
|
|
|
);
|
2024-11-11 17:52:23 +01:00
|
|
|
};
|
|
|
|
}
|