Skip to content

nix based CI

nix based CI #2

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel in-progress runs for the same branch/PR
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt-check:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check formatting
run: nix develop .#ci --command zig fmt --check src/ tests/ bench/ build.zig
unit-tests:
name: Unit Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run unit tests
run: nix develop .#ci --command zig build test --summary all
smoke-tests:
name: Smoke Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Start OpenSearch
run: nix develop .#ci --command es-start
- name: Run smoke tests
run: nix develop .#ci --command zig build test-smoke --summary all
env:
ES_URL: http://localhost:9200
- name: Stop OpenSearch
if: always()
run: nix develop .#ci --command es-stop
integration-tests:
name: Integration Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: [unit-tests]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Start OpenSearch
run: nix develop .#ci --command es-start
- name: Run integration tests
run: nix develop .#ci --command zig build test-integration --summary all
env:
ES_URL: http://localhost:9200
- name: Stop OpenSearch
if: always()
run: nix develop .#ci --command es-stop
build-check:
name: Build Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Nix build (reproducible)
run: nix build
- name: Nix flake check
run: nix flake check