Skip to content

Update cachix/install-nix-action action to v29 #694

Update cachix/install-nix-action action to v29

Update cachix/install-nix-action action to v29 #694

Workflow file for this run

name: Build and test flake outputs
on:
push:
workflow_dispatch:
workflow_call:
inputs:
branch:
description: Branch name to build on
default: ""
required: false
type: string
secrets:
CACHIX_ACTIVATE_TOKEN:
CACHIX_AUTH_TOKEN:
required: true
jobs:
nix:
runs-on: "${{ matrix.system == 'aarch64' && 'self-hosted' || 'ubuntu-latest' }}"
strategy:
fail-fast: false
matrix:
system:
- aarch64
- x86_64
nix-command:
- fmt -- --check
- eval .#apps.$_system.nixos-shell.program
- eval .#apps.$_system.setup.program
include:
# - nix-command: develop .#jdk8 --profile result
# system: x86_64
# - nix-command: develop .#jdk11 --profile result
# system: x86_64
# - nix-command: develop .#jdk17 --profile result
# system: x86_64
# - nix-command: develop .#php74 --profile result
# system: x86_64
# - nix-command: develop .#php74-composer1 --profile result
# system: x86_64
# - nix-command: develop .#php80 --profile result
# system: x86_64
# - nix-command: develop .#php81 --profile result
# system: x86_64
- nix-command: build .#homeConfigurations."tobias@gamer".activationPackage
system: x86_64
- nix-command: build .#nixOnDroidConfigurations.pixel7a.activationPackage --impure
system: aarch64
- nix-command: build .#nixosConfigurations.argon.config.system.build.toplevel
system: aarch64
deploy-agent: argon
- nix-command: build .#nixosConfigurations.krypton.config.system.build.toplevel
system: x86_64
deploy-agent: krypton
- nix-command: build .#nixosConfigurations.neon.config.system.build.toplevel
system: x86_64
deploy-agent: neon
deploy-args: --async
- nix-command: build .#nixosConfigurations.xenon.config.system.build.toplevel
system: aarch64
deploy-agent: xenon
# - nix-command: build .#packages.$_system.rpi-firmware
# system: aarch64
# - nix-command: build .#packages.$_system.rpi-image
# system: aarch64
# - nix-command: build .#packages.$_system.installer-image
# system: x86_64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
continue-on-error: true
if: matrix.system == 'x86_64'
with:
tool-cache: true
- name: Install nix
uses: cachix/install-nix-action@v29
if: matrix.system == 'x86_64'
with:
extra_nix_config: |
keep-going = true
- name: Setup cachix (gerschtli)
uses: cachix/cachix-action@v15
with:
name: gerschtli
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Setup cachix (nix-on-droid)
uses: cachix/cachix-action@v15
with:
name: nix-on-droid
useDaemon: false
- name: Build command
env:
_system: ${{ matrix.system }}-linux
run: nix ${{ matrix.nix-command }}
- name: Remove result symlink
if: always()
run: rm --force result
- name: Deploy cachix-agent spec
if: github.ref == 'refs/heads/master' && inputs.branch == '' && matrix.deploy-agent
env:
CACHIX_ACTIVATE_TOKEN: ${{ secrets.CACHIX_ACTIVATE_TOKEN }}
run: |
echo "::group::Build spec"
spec="$(nix build --print-out-paths ".#cachix-deploy-spec-${{ matrix.deploy-agent }}")"
echo "::group::Upload spec"
cachix push gerschtli "$spec"
echo "::group::Activate deployment"
cachix deploy activate --agent "${{ matrix.deploy-agent }}" ${{ matrix.deploy-args }} "$spec"
# vim: set sw=2: