mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
CI changes (all hosts)
This commit is contained in:
parent
4047af32c6
commit
0bd5d2b237
3 changed files with 118 additions and 3 deletions
114
.github/workflows/hosts.yml
vendored
114
.github/workflows/hosts.yml
vendored
|
|
@ -85,6 +85,120 @@ jobs:
|
|||
command: ci-build-cache
|
||||
quiet: false
|
||||
stdin: ${{ runner.temp }}/ci.build.cache
|
||||
host-beltane:
|
||||
name: hosts-host-beltane
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: checkout
|
||||
name: git clone
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: false
|
||||
- id: nix-install
|
||||
name: nix install
|
||||
uses: arcnmx/ci/actions/nix/install@master
|
||||
- id: ci-setup
|
||||
name: nix setup
|
||||
uses: arcnmx/ci/actions/nix/run@master
|
||||
with:
|
||||
attrs: ci.job.host-beltane.run.bootstrap
|
||||
quiet: false
|
||||
- id: ci-dirty
|
||||
name: nix test dirty
|
||||
uses: arcnmx/ci/actions/nix/run@master
|
||||
with:
|
||||
attrs: ci.job.host-beltane.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@master
|
||||
with:
|
||||
attrs: ci.job.host-beltane.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@master
|
||||
with:
|
||||
attrs: ci.job.host-beltane.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@master
|
||||
with:
|
||||
attrs: ci.job.host-beltane.run.test
|
||||
command: ci-build-cache
|
||||
quiet: false
|
||||
stdin: ${{ runner.temp }}/ci.build.cache
|
||||
host-ostara:
|
||||
name: hosts-host-ostara
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: checkout
|
||||
name: git clone
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
submodules: false
|
||||
- id: nix-install
|
||||
name: nix install
|
||||
uses: arcnmx/ci/actions/nix/install@master
|
||||
- id: ci-setup
|
||||
name: nix setup
|
||||
uses: arcnmx/ci/actions/nix/run@master
|
||||
with:
|
||||
attrs: ci.job.host-ostara.run.bootstrap
|
||||
quiet: false
|
||||
- id: ci-dirty
|
||||
name: nix test dirty
|
||||
uses: arcnmx/ci/actions/nix/run@master
|
||||
with:
|
||||
attrs: ci.job.host-ostara.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@master
|
||||
with:
|
||||
attrs: ci.job.host-ostara.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@master
|
||||
with:
|
||||
attrs: ci.job.host-ostara.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@master
|
||||
with:
|
||||
attrs: ci.job.host-ostara.run.test
|
||||
command: ci-build-cache
|
||||
quiet: false
|
||||
stdin: ${{ runner.temp }}/ci.build.cache
|
||||
host-samhain:
|
||||
name: hosts-host-samhain
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
'';
|
||||
};
|
||||
|
||||
jobs = let hostnames = [ "samhain" "yule" "athame" ];
|
||||
jobs = let hostnames = remove "dummy" (lib.attrNames (import ../.).hosts);
|
||||
in mapAttrs' (k: nameValuePair "host-${k}") (genAttrs hostnames (host: {
|
||||
tasks.${host}.inputs = channels.nixfiles.network.nodes.${host}.deploy.system;
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ with lib; {
|
|||
};
|
||||
displayName = "niv update build";
|
||||
environment = [ "OPENSSH_PRIVATE_KEY" "CACHIX_SIGNING_KEY" "GITHUB_REF" ];
|
||||
command = ''
|
||||
command = let hostnames = remove "dummy" (lib.attrNames (import ../.).hosts);
|
||||
hostBuildString = concatMapStrings (host: "nix build -Lf . network.nodes.${host}.deploy.system && nix-collect-garbage -d && " ) hostnames; in ''
|
||||
# ${toString builtins.currentTime}
|
||||
if [[ -n $OPENSSH_PRIVATE_KEY ]]; then
|
||||
mkdir ~/.ssh
|
||||
|
|
@ -75,7 +76,7 @@ with lib; {
|
|||
git -P diff nix/sources.json
|
||||
nix build --no-link -Lf . sourceCache.local
|
||||
echo "checking that network.nodes.still build..." >&2
|
||||
if nix build -Lf . network.nodes.athame.deploy.system && nix-collect-garbage -d && nix build -Lf . network.nodes.yule.system && nix-collect-garbage -d && nix build -Lf . network.nodes.samhain.system; then
|
||||
if ${hostBuildString}; then
|
||||
if [[ -n $CACHIX_SIGNING_KEY ]]; then
|
||||
nix build --no-link -Lf . sourceCache.all
|
||||
cachix push kittywitch $(nix eval --raw -f . sourceCache.allStr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue