Automated Flake update #4598
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build pull request" | |
on: | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
tests: | |
name: "Build ${{ matrix.target }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-24.04 | |
target: nixosConfigurations.sandhose-desktop.config.system.build.toplevel | |
- os: ubuntu-24.04 | |
target: nixosConfigurations.spaetzle.config.system.build.toplevel | |
- os: macos-15 | |
target: darwinConfigurations.sandhose-laptop-m1.system | |
steps: | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
- name: Setup cachix | |
uses: cachix/cachix-action@v15 | |
with: | |
name: sandhose | |
skipPush: true | |
extraPullNames: nix-community | |
- name: Build system | |
env: | |
TARGET: "github:${{ github.repository }}/${{ github.ref }}#${{ matrix.target }}" | |
run: nix build $TARGET --fallback --log-format raw --print-build-logs | |
- name: Garbage collect build dependencies | |
run: nix-collect-garbage | |
- name: Fetch old system to profile | |
env: | |
TARGET: "github:${{ github.repository }}/${{ github.base_ref }}#${{ matrix.target }}" | |
run: nix build $TARGET --log-format raw --print-build-logs --profile ./profile | |
- name: Add new system to profile | |
env: | |
TARGET: "github:${{ github.repository }}/${{ github.ref }}#${{ matrix.target }}" | |
run: nix build $TARGET --log-format raw --print-build-logs --profile ./profile | |
- name: Diff profile | |
id: diff | |
run: | | |
delimiter="$(openssl rand -hex 16)" | |
echo "diff<<${delimiter}" >> "${GITHUB_OUTPUT}" | |
nix profile diff-closures --profile ./profile | perl -pe 's/\e\[[0-9;]*m(?:\e\[K)?//g' >> "${GITHUB_OUTPUT}" | |
echo "${delimiter}" >> "${GITHUB_OUTPUT}" | |
- name: Comment PR | |
uses: marocchino/sticky-pull-request-comment@v2 | |
with: | |
header: ".#${{ matrix.target }}" | |
message: | | |
### Diff of `${{ matrix.target }}` | |
``` | |
${{ steps.diff.outputs.diff }} | |
``` |