name: Nix flake
on:
push:
branches: [master]
paths:
- "flake.nix"
- "flake.lock"
- "Cargo.toml"
- "Cargo.lock"
- "**/Cargo.toml"
- "src/**"
- "crates/**"
- ".github/workflows/nix.yml"
pull_request:
branches: [master]
paths:
- "flake.nix"
- "flake.lock"
- "Cargo.toml"
- "Cargo.lock"
- "**/Cargo.toml"
- "src/**"
- "crates/**"
- ".github/workflows/nix.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
permissions:
contents: read
jobs:
build:
name: nix build .#markdown-reader (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v22
- name: Cache Nix store
uses: DeterminateSystems/magic-nix-cache-action@v13
- name: nix flake check
run: nix flake check --no-build
- name: nix build .#markdown-reader
run: nix build .#markdown-reader --print-build-logs
- name: Smoke-test the built binary
run: ./result/bin/markdown-reader --help