Automated Flake update #3346
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-20.04 | |
target: nixosConfigurations.sandhose-desktop.config.system.build.toplevel | |
- os: ubuntu-20.04 | |
target: nixosConfigurations.spaetzle.config.system.build.toplevel | |
- os: macos-11 | |
target: darwinConfigurations.sandhose-laptop.system | |
steps: | |
- name: Create Nix mount point | |
if: contains(matrix.os, 'ubuntu') | |
run: sudo mkdir /nix | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@v8 | |
if: contains(matrix.os, 'ubuntu') | |
with: | |
root-reserve-mb: 512 | |
swap-size-mb: 1024 | |
remove-dotnet: "true" | |
remove-android: "true" | |
remove-haskell: "true" | |
remove-codeql: "true" | |
remove-docker-image: "true" | |
build-mount-path: "/nix" | |
overprovision-lvm: "true" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: cachix/install-nix-action@v23 | |
with: | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- uses: cachix/cachix-action@v12 | |
with: | |
name: sandhose | |
skipPush: true | |
extraPullNames: nix-community | |
- name: Build system | |
env: | |
TARGET: ".#${{ matrix.target }}" | |
run: nix build $TARGET --show-trace --fallback -v --log-format raw | |
- name: Garbage collect build dependencies | |
run: nix-collect-garbage | |
- name: Fetch old system to profile | |
env: | |
TARGET: "github:sandhose/nixconf#${{ matrix.target }}" | |
run: nix build $TARGET -v --log-format raw --profile ./profile | |
- name: Add new system to profile | |
env: | |
TARGET: ".#${{ matrix.target }}" | |
run: nix build $TARGET -v --log-format raw --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 }} | |
``` |