Skip to content

gh-actions: specify more runners tags #23

gh-actions: specify more runners tags

gh-actions: specify more runners tags #23

Workflow file for this run

name: build system configurations with nix
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
changed-files:
runs-on: ubuntu-latest
name: Test changed-files
outputs:
nix-changed: ${{ steps.changed-files.outputs.nix_any_changed == 'true' }}
notnix-changed: ${{ steps.changed-files.outputs.notnix_any_changed == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get all changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
nix:
- flake.lock
- flake.nix
- config/**
- home-manager/**
- nix-darwin/**
- nixos/**
- overlays/**
- profiles/**
- '.github/workflows/build.yml'
- 'Makefile'
notnix:
- aqua/**
- sheldon/**
- '.github/workflows/build.yml'
- 'Makefile'
nix-build:
runs-on: ${{ matrix.os }}
name: Build Nix Configuration
needs: changed-files
if: needs.changed-files.outputs.nix-changed == 'true'
strategy:
matrix:
os:
- [self-hosted, X64, Linux, nix]
- [macos-14]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: install nix
if: matrix.os == 'macos-14' # skip for self-hosted runner (assumes already installed)
uses: cachix/install-nix-action@v30
- name: Adding Nix PATH
if: matrix.os == 'self-hosted'
run: |
echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
echo "$HOME/.nix-profile/bin" >> "$GITHUB_PATH"
- name: Check nix installation
if: matrix.os == 'self-hosted'
run: |
make RUNS_ENV=ci test
- name: Create /run for darwin
if: matrix.os == 'macos-14'
run: |
printf "run\tprivate/var/run\n" | sudo tee -a /etc/synthetic.conf
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t || true
- name: Cache setup
if: matrix.os == 'macos-14'
uses: DeterminateSystems/magic-nix-cache-action@main
- name: build
run: |
make RUNS_ENV=ci ci-build
df -h