chore(workflows): Use nix-shell helper

This commit is contained in:
Tom Hubrecht 2025-01-15 10:49:10 +01:00
parent ea9f513459
commit 18137768ae
Signed by: thubrecht
SSH key fingerprint: SHA256:CYNvFo44Ar9qCNnWNnvJVhs0QXO9AZjOLlPeWcSij3Q
11 changed files with 38 additions and 9 deletions

View file

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: EUPL-1.2
{ nix-actions, ... }:
{
name = "Check workflows";
on = {
@ -13,10 +15,13 @@
check_workflows = {
runs-on = "nix";
steps = [
{ uses = "actions/checkout@v3"; }
(nix-actions.steps.checkout { })
{
name = "Check that the workflows are up to date";
run = "nix-shell -A check-workflows --run '[ $(git status --porcelain | wc -l) -eq 0 ]'";
run = nix-actions.lib.nix-shell {
script = "[ $(git status --porcelain | wc -l) -eq 0 ]";
shell = "check-workflows";
};
}
];
};

View file

@ -23,7 +23,10 @@ in
{ uses = "actions/checkout@v3"; }
{
name = "Build and cache ${node}";
run = "nix-shell -A eval-nodes --run cache-node";
run = nix-actions.lib.nix-shell {
script = "cache-node";
shell = "eval-nodes";
};
env = {
STORE_ENDPOINT = "https://tvix-store.dgnum.eu/infra-signing/";
STORE_USER = "admin";

View file

@ -18,7 +18,10 @@
{ uses = "actions/checkout@v3"; }
{
name = "Build and cache shell";
run = ''nix-shell -A eval-shell --run "nix-build-and-cache -A devShell"'';
run = nix-actions.lib.nix-shell {
script = "nix-build-and-cache -A devShell";
shell = "eval-shell";
};
env = {
STORE_ENDPOINT = "https://tvix-store.dgnum.eu/infra-signing/";
STORE_USER = "admin";

View file

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: EUPL-1.2
{ nix-actions, ... }:
{
name = "Run pre-commit on all files";
on = [
@ -16,7 +18,10 @@
++ (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'";
run = nix-actions.lib.nix-shell {
script = "pre-commit run --all-files --hook-stage ${stage} --show-diff-on-failure";
shell = "pre-commit";
};
})
[
"pre-commit"