Nixbuild.net CI Workflow for GitHub Actions

We’ve published a Reusable Workflow for GitHub Actions that evaluates a flake.nix file from your repo and then generates individual GitHub Actions jobs for each build. All builds are then built using nixbuild.net. In the end, individual build results are collected and made available as workflow outputs, which means you can process the build results as you like in a subsequent job. Also, all build logs are uploaded as workflow artifacts.

Basically, this is similar to what https://garnix.io/ does, but it runs on GitHub Actions (and integrates with your own workflows) instead of as a GitHub App. By using nixbuild.net it of course also gives you all of its nice features :slight_smile:

To give you a feeling for how it works, take this minimal flake as an example:

{
  inputs = {
    nix.url = "github:nixos/nix/master";
  };

  outputs = { self, nix }: {
    inherit (nix) checks;
  };
}

The flake simply imports all checks from the flake that the Nix project defines (so, we’re cheating a bit here, just to get some builds running). Then we define the following GitHub Actions Workflow:

name: nix-ci-nixbuild-ci

on:
  push:

jobs:
  checks:
    uses: nixbuild/nixbuild-action/.github/workflows/ci-workflow.yml@v10
    secrets:
      nixbuild_ssh_key: ${{ secrets.nixbuild_ssh_key }}

The resulting “CI dashboard” in GitHub Actions looks like this:

The above example workflow is available here. There is also another example available, showing how the build results can be used in a more complex workflow.

5 Likes