CI changes (all hosts)

This commit is contained in:
kat witch 2021-08-08 21:34:35 +01:00
parent 4047af32c6
commit 0bd5d2b237
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
3 changed files with 118 additions and 3 deletions

View file

@ -85,6 +85,120 @@ 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
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: host-samhain:
name: hosts-host-samhain name: hosts-host-samhain
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -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: { in mapAttrs' (k: nameValuePair "host-${k}") (genAttrs hostnames (host: {
tasks.${host}.inputs = channels.nixfiles.network.nodes.${host}.deploy.system; tasks.${host}.inputs = channels.nixfiles.network.nodes.${host}.deploy.system;
})); }));

View file

@ -46,7 +46,8 @@ with lib; {
}; };
displayName = "niv update build"; displayName = "niv update build";
environment = [ "OPENSSH_PRIVATE_KEY" "CACHIX_SIGNING_KEY" "GITHUB_REF" ]; 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} # ${toString builtins.currentTime}
if [[ -n $OPENSSH_PRIVATE_KEY ]]; then if [[ -n $OPENSSH_PRIVATE_KEY ]]; then
mkdir ~/.ssh mkdir ~/.ssh
@ -75,7 +76,7 @@ with lib; {
git -P diff nix/sources.json git -P diff nix/sources.json
nix build --no-link -Lf . sourceCache.local nix build --no-link -Lf . sourceCache.local
echo "checking that network.nodes.still build..." >&2 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 if [[ -n $CACHIX_SIGNING_KEY ]]; then
nix build --no-link -Lf . sourceCache.all nix build --no-link -Lf . sourceCache.all
cachix push kittywitch $(nix eval --raw -f . sourceCache.allStr) cachix push kittywitch $(nix eval --raw -f . sourceCache.allStr)