mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
fix(ci): update system list
This commit is contained in:
parent
32bc421560
commit
0fbd142a16
5 changed files with 96 additions and 17 deletions
51
.github/workflows/nodes.yml
vendored
51
.github/workflows/nodes.yml
vendored
|
|
@ -436,6 +436,57 @@ jobs:
|
||||||
command: ci-build-cache
|
command: ci-build-cache
|
||||||
quiet: false
|
quiet: false
|
||||||
stdin: ${{ runner.temp }}/ci.build.cache
|
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
|
name: nodes
|
||||||
'on':
|
'on':
|
||||||
- push
|
- push
|
||||||
|
|
|
||||||
|
|
@ -11,32 +11,58 @@ NIX_BUILD_ARGS=(
|
||||||
--show-trace
|
--show-trace
|
||||||
)
|
)
|
||||||
|
|
||||||
for nfsystem in "${NF_NIX_SYSTEMS[@]}"; do
|
init_nfargs() {
|
||||||
|
nflinksuffix="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
nfargs=(
|
nfargs=(
|
||||||
"${NIX_BUILD_ARGS[@]}"
|
"${NIX_BUILD_ARGS[@]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
|
if [[ -n "${NF_ACTIONS_TEST_OUTLINK-}" || -n "${NF_UPDATE_CACHIX_PUSH-}" ]]; then
|
||||||
nfargs+=(
|
nfargs+=(
|
||||||
-o "${NF_ACTIONS_TEST_OUTLINK-result}-$nfsystem"
|
-o "${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
nfargs+=(
|
nfargs+=(
|
||||||
--no-link
|
--no-link
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
echo "building ${nfsystem}..." >&2
|
nfgc() {
|
||||||
|
if [[ -n ${NF_ACTIONS_TEST_GC-} ]]; then
|
||||||
nix build \
|
if [[ -n ${NF_UPDATE_CACHIX_PUSH-} ]]; then
|
||||||
"${NF_CONFIG_ROOT}#nixosConfigurations.${nfsystem}.config.system.build.toplevel" \
|
cachix push gensokyo-infrastructure "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*/
|
||||||
"${nfargs[@]}" \
|
rm -f "./${NF_ACTIONS_TEST_OUTLINK-result}$nflinksuffix"*
|
||||||
"$@"
|
|
||||||
|
|
||||||
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"*
|
|
||||||
fi
|
fi
|
||||||
nix-collect-garbage -d
|
nix-collect-garbage -d
|
||||||
fi
|
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
|
done
|
||||||
|
|
||||||
|
if [[ -n ${NF_ACTIONS_TEST_ASYNC-} ]]; then
|
||||||
|
init_nfargs ""
|
||||||
|
nix build \
|
||||||
|
"${nfargs[@]}" \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
nfgc
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
"flake-cron.nix"
|
"flake-cron.nix"
|
||||||
];
|
];
|
||||||
nixosSystems = [
|
nixosSystems = [
|
||||||
|
"ct"
|
||||||
"hakurei"
|
"hakurei"
|
||||||
"reimu"
|
"reimu"
|
||||||
"aya"
|
"aya"
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ with lib; {
|
||||||
};
|
};
|
||||||
|
|
||||||
jobs = let
|
jobs = let
|
||||||
enabledHosts = ["hakurei" "reimu" "aya" "tei" "litterbox" "keycloak" "mediabox" "ct"];
|
inherit ((import ./nix.nix).ci) nixosSystems;
|
||||||
in
|
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;
|
tasks.${host}.inputs = channels.nixfiles.nixosConfigurations.${host}.config.system.build.toplevel;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
inputs,
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (inputs.self) nixosConfigurations;
|
||||||
inherit (inputs.self.lib) systems;
|
inherit (inputs.self.lib) systems;
|
||||||
inherit (inputs.self.lib.lib) domain;
|
inherit (inputs.self.lib.lib) domain;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
|
@ -94,8 +95,8 @@ in {
|
||||||
inherit (cfg) hostnameForNetwork;
|
inherit (cfg) hostnameForNetwork;
|
||||||
systemFor = hostName: systems.${hostName}.config;
|
systemFor = hostName: systems.${hostName}.config;
|
||||||
systemForOrNull = hostName: systems.${hostName}.config or null;
|
systemForOrNull = hostName: systems.${hostName}.config or null;
|
||||||
nixosFor = hostName: (access.systemFor hostName).built.config;
|
nixosFor = hostName: nixosConfigurations.${hostName}.config or (access.systemFor hostName).built.config;
|
||||||
nixosForOrNull = hostName: (access.systemForOrNull hostName).built.config or null;
|
nixosForOrNull = hostName: nixosConfigurations.${hostName}.config or (access.systemForOrNull hostName).built.config or null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue