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

@ -1,3 +1,5 @@
###
# This file was automatically generated with nix-actions.
jobs:
check_dns:
runs-on: nix

View file

@ -1,8 +1,11 @@
###
# This file was automatically generated with nix-actions.
jobs:
check_workflows:
runs-on: nix
steps:
- uses: actions/checkout@v3
with: {}
- name: Check that the workflows are up to date
run: nix-shell -A check-workflows --run '[ $(git status --porcelain | wc -l)
-eq 0 ]'

View file

@ -1,3 +1,5 @@
###
# This file was automatically generated with nix-actions.
jobs:
ap01:
runs-on: nix

View file

@ -1,3 +1,5 @@
###
# This file was automatically generated with nix-actions.
jobs:
build-shell:
runs-on: nix
@ -8,7 +10,7 @@ jobs:
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
STORE_USER: admin
name: Build and cache shell
run: nix-shell -A eval-shell --run "nix-build-and-cache -A devShell"
run: nix-shell -A eval-shell --run 'nix-build-and-cache -A devShell'
name: Build the shell
on:
pull_request:

View file

@ -1,3 +1,5 @@
###
# This file was automatically generated with nix-actions.
env:
GIT_AUTHOR_EMAIL: chores@mail.hubrecht.ovh
GIT_AUTHOR_NAME: HT Chores

View file

@ -1,3 +1,5 @@
###
# This file was automatically generated with nix-actions.
jobs:
pre-commit:
runs-on: nix

View file

@ -225,10 +225,10 @@
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"version": "v0.3.0",
"revision": "15a5f4cd9909cad78c8be852d176def42d5ab3cd",
"version": "v0.4.2",
"revision": "6cf7970c0916cc3c05b5289d28ec89b4e35b6e5b",
"url": null,
"hash": "16gssfs2qxy1nqnfqpbn076i79zna295jzix897346ic3gy11610"
"hash": "0y9z1l1b6g1nj7l3xypbs1fnlad31ny7n8v23n35hd6nbwyslikf"
},
"nix-modules": {
"type": "Git",

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"