Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Nix

on:
workflow_dispatch:
inputs:
job:
description: Nix job to run
type: choice
options:
- check
- build
default: check
pull_request:
types: [labeled]

permissions:
contents: read

concurrency:
group: nix-${{ github.ref }}
cancel-in-progress: true

jobs:
nix:
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'ci/nix'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Nix
uses: ./.github/actions/nix-setup
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Run Nix job
run: scripts/nix-ci.sh "${{ github.event.inputs.job || 'check' }}"
17 changes: 17 additions & 0 deletions scripts/nix-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

case "${1:-check}" in
check)
nix flake check --print-build-logs
;;
build)
nix build .#default .#tui .#web .#desktop \
--no-link --print-build-logs
;;
*)
echo "Usage: $0 [check|build]" >&2
exit 2
;;
esac
Loading