Skip to content

CI - Nix

CI - Nix #1404

Workflow file for this run

name: CI - Nix
on:
push:
tags:
- 'v*'
branches: [main]
paths:
- '.github/workflows/ci-nix.yml'
- '*.nix'
- 'flake.*'
- 'go.mod'
- 'Taskfile.yml'
- 'examples/**'
pull_request:
paths:
- '.github/workflows/ci-nix.yml'
- '*.nix'
- 'flake.*'
- 'go.mod'
- 'Taskfile.yml'
- 'examples/**'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 1 * * *'
workflow_dispatch:
permissions:
contents: read
jobs:
tasks:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# Dont' set extra-conf to test the devShell behavior
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
- run: nix flake check
- run: nix develop --command echo 'This step should be done before any other "nix develop" steps because of measuring Nix build time'
- run: nix develop --command task
package:
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-24.04
- ubuntu-24.04-arm
- macos-26
- macos-15-intel
runs-on: ${{ matrix.runner }}
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# Don't use "DeterminateSystems/nix-installer-action". It does not run on x86_64-darwin: https://github.com/DeterminateSystems/nix-src/issues/224
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
with:
extra_nix_config: |
sandbox = true
accept-flake-config = true
- uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
with:
name: selfup
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
skipPush: ${{ !startsWith(github.ref, 'refs/tags/v') }}
- run: nix run . -- --version