From eff519419e6b5fd4019e086efc1d462d0660f346 Mon Sep 17 00:00:00 2001 From: kat witch Date: Thu, 13 May 2021 18:38:17 +0100 Subject: [PATCH] ci: Moved to jobs --- .github/workflows/nixfiles.yml | 228 ++++++++++++++++++++++++--------- ci.nix | 5 +- 2 files changed, 174 insertions(+), 59 deletions(-) diff --git a/.github/workflows/nixfiles.yml b/.github/workflows/nixfiles.yml index 171a8b64..e1426096 100644 --- a/.github/workflows/nixfiles.yml +++ b/.github/workflows/nixfiles.yml @@ -3,63 +3,6 @@ env: CI_CONFIG: ./ci.nix CI_PLATFORM: gh-actions jobs: - ci: - name: nixfiles - 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.run.bootstrap - quiet: false - - id: ci-dirty - name: nix test dirty - uses: arcnmx/ci/actions/nix/run@master - with: - attrs: ci.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.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.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.run.test - command: ci-build-cache - quiet: false - stdin: ${{ runner.temp }}/ci.build.cache ci-check: name: nixfiles check runs-on: ubuntu-latest @@ -85,6 +28,177 @@ jobs: args: -u .github/workflows/nixfiles.yml .ci/workflow.yml attrs: nixpkgs.diffutils command: diff + host-athame: + name: nixfiles-host-athame + 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-athame.run.bootstrap + quiet: false + - id: ci-dirty + name: nix test dirty + uses: arcnmx/ci/actions/nix/run@master + with: + attrs: ci.job.host-athame.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-athame.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-athame.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-athame.run.test + command: ci-build-cache + quiet: false + stdin: ${{ runner.temp }}/ci.build.cache + host-samhain: + name: nixfiles-host-samhain + 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-samhain.run.bootstrap + quiet: false + - id: ci-dirty + name: nix test dirty + uses: arcnmx/ci/actions/nix/run@master + with: + attrs: ci.job.host-samhain.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-samhain.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-samhain.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-samhain.run.test + command: ci-build-cache + quiet: false + stdin: ${{ runner.temp }}/ci.build.cache + host-yule: + name: nixfiles-host-yule + 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-yule.run.bootstrap + quiet: false + - id: ci-dirty + name: nix test dirty + uses: arcnmx/ci/actions/nix/run@master + with: + attrs: ci.job.host-yule.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-yule.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-yule.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-yule.run.test + command: ci-build-cache + quiet: false + stdin: ${{ runner.temp }}/ci.build.cache name: nixfiles 'on': - push diff --git a/ci.nix b/ci.nix index f960a01d..d54b5ff4 100644 --- a/ci.nix +++ b/ci.nix @@ -3,8 +3,9 @@ ci.gh-actions.enable = true; ci.gh-actions.export = true; - tasks = let hostnames = [ "samhain" "yule" "athame" ]; + jobs = let hostnames = [ "samhain" "yule" "athame" ]; in mapAttrs' (k: nameValuePair "host-${k}") (genAttrs hostnames (host: { + tasks = { inputs = with channels.cipkgs; ci.command { name = "build-${host}"; displayName = "build hosts/${host}"; @@ -13,8 +14,8 @@ nix build -Lf . hosts.${host}.config.system.build.toplevel --show-trace --no-link nix-collect-garbage ''; - impure = true; }; + }; })); ci.gh-actions.checkoutOptions.submodules = false;