fix(ci): update system list

This commit is contained in:
arcnmx 2024-03-25 10:53:26 -07:00
parent 32bc421560
commit 0fbd142a16
5 changed files with 96 additions and 17 deletions

View file

@ -436,6 +436,57 @@ jobs:
command: ci-build-cache
quiet: false
stdin: ${{ runner.temp }}/ci.build.cache
utsuho:
name: nodes-utsuho
runs-on: ubuntu-latest
steps:
- id: checkout
name: git clone
uses: actions/checkout@v4
with:
submodules: false
- id: nix-install
name: nix install
uses: arcnmx/ci/actions/nix/install@v0.7
- id: ci-dirty
name: nix test dirty
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.utsuho.run.test
command: ci-build-dirty
quiet: false
stdout: ${{ runner.temp }}/ci.build.dirty
- id: ci-test
name: nix test build
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.utsuho.run.test
command: ci-build-realise
ignore-exit-code: true
quiet: false
stdin: ${{ runner.temp }}/ci.build.dirty
- env:
CI_EXIT_CODE: ${{ steps.ci-test.outputs.exit-code }}
id: ci-summary
name: nix test results
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.utsuho.run.test
command: ci-build-summarise
quiet: false
stdin: ${{ runner.temp }}/ci.build.dirty
stdout: ${{ runner.temp }}/ci.build.cache
- env:
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
id: ci-cache
if: always()
name: nix test cache
uses: arcnmx/ci/actions/nix/run@v0.7
with:
attrs: ci.job.utsuho.run.test
command: ci-build-cache
quiet: false
stdin: ${{ runner.temp }}/ci.build.cache
name: nodes
'on':
- push

View file

@ -11,32 +11,58 @@ NIX_BUILD_ARGS=(
--show-trace
)
for nfsystem in "${NF_NIX_SYSTEMS[@]}"; do
init_nfargs() {
nflinksuffix="$1"
shift
nfargs=(
"${NIX_BUILD_ARGS[@]}"
)
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
nfargs+=(
-o "${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"
-o "${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"
)
else
nfargs+=(
--no-link
)
fi
}
echo "building ${nfsystem}..." >&2
nix build \
"${NF_CONFIG_ROOT}#nixosConfigurations.${nfsystem}.config.system.build.toplevel" \
"${nfargs[@]}" \
"$@"
if [[ -n "${NF_ACTIONS_TEST_GC-}" ]]; then
if [[ -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
cachix push gensokyo-infrastructure "./${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"*/
rm -f "./${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"*
nfgc() {
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
cachix push gensokyo-infrastructure "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
rm -f "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*
fi
nix-collect-garbage -d
fi
}
for nfsystem in "${NF_NIX_SYSTEMS[@]}"; do
nfinstallable="${NF_CONFIG_ROOT}#nixosConfigurations.${nfsystem}.config.system.build.toplevel"
init_nfargs "-$nfsystem"
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
NIX_BUILD_ARGS+=("$nfinstallable")
continue
fi
echo "building ${nfsystem}..." >&2
nix build "$nfinstallable" \
"${nfargs[@]}" \
"$@"
nfgc
done
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
init_nfargs ""
nix build \
"${nfargs[@]}" \
"$@"
nfgc
fi

View file

@ -5,6 +5,7 @@
"flake-cron.nix"
];
nixosSystems = [
"ct"
"hakurei"
"reimu"
"aya"

View file

@ -25,9 +25,9 @@ with lib; {
};
jobs = let
enabledHosts = ["hakurei" "reimu" "aya" "tei" "litterbox" "keycloak" "mediabox" "ct"];
inherit ((import ./nix.nix).ci) nixosSystems;
in
mapAttrs' (k: nameValuePair "${k}") (genAttrs enabledHosts (host: {
mapAttrs' (k: nameValuePair "${k}") (genAttrs nixosSystems (host: {
tasks.${host}.inputs = channels.nixfiles.nixosConfigurations.${host}.config.system.build.toplevel;
}));

View file

@ -6,6 +6,7 @@
inputs,
...
}: let
inherit (inputs.self) nixosConfigurations;
inherit (inputs.self.lib) systems;
inherit (inputs.self.lib.lib) domain;
inherit (lib.options) mkOption mkEnableOption;
@ -94,8 +95,8 @@ in {
inherit (cfg) hostnameForNetwork;
systemFor = hostName: systems.${hostName}.config;
systemForOrNull = hostName: systems.${hostName}.config or null;
nixosFor = hostName: (access.systemFor hostName).built.config;
nixosForOrNull = hostName: (access.systemForOrNull hostName).built.config or null;
nixosFor = hostName: nixosConfigurations.${hostName}.config or (access.systemFor hostName).built.config;
nixosForOrNull = hostName: nixosConfigurations.${hostName}.config or (access.systemForOrNull hostName).built.config or null;
};
};
}