Skip to content

ci: move to Nix

ci: move to Nix #16

on: [push, pull_request]
name: CI
jobs:
self-care:
name: Flake self-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v5
with:
fail-mode: true
pre-commit-checks:
name: "Pre-commit checks: typos, pgp-signed and conventional commits"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Commit checks
- name: Pre-commit checks
run: nix build -L .#ci.pre-commit-check
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Rustfmt
- name: Rustfmt
run: nix build -L .#ci.fmt
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Clippy
- name: Clippy
run: nix build -L .#ci.clippy
test-latest:
name: Build, test, check latest Rust
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Cache Builds
- name: Build and Cache latest Rust
run: nix build -L .
# Tests: latest
- name: Test workspace all-features latest
run: nix build -L .#ci.latest.all
- name: Test workspace no-default-features latest
run: nix build -L .#ci.latest.noDefault
- name: Test bdk no-std latest
run: nix build -L .#ci.latest.noStdBdk
- name: Test bdk_chain no-std latest
run: nix build -L .#ci.latest.noStdChain
- name: Test bdk_esplora no-std latest
run: nix build -L .#ci.latest.noStdEsplora
test-MSRV:
name: Build, test, check MSRV
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Cache Builds
- name: Build and Cache MSRV
run: nix build -L .#MSRV
# Tests: MSRV
- name: Test workspace all-features MSRV
run: nix build -L .#ci.MSRV.all
- name: Test workspace no-default-features MSRV
run: nix build -L .#ci.MSRV.noDefault
- name: Test bdk no-std MSRV
run: nix build -L .#ci.MSRV.noStdBdk
- name: Test bdk_chain no-std MSRV
run: nix build -L .#ci.MSRV.noStdChain
- name: Test bdk_esplora no-std MSRV
run: nix build -L .#ci.MSRV.noStdEsplora
check-WASM:
name: Build and check WASM
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Cache Builds
- name: Build and Cache WASM
run: nix build -L .#WASM
# Checks: WASM
- name: Check bdk WASM
run: nix build -L .#ci.WASM.bdk
- name: Check bdk_esplora WASM
run: nix build -L .#ci.WASM.esplora
audit:
name: Audit based on rustsec/advisory-db
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v5
# Cache Nix artifacts
- uses: DeterminateSystems/magic-nix-cache-action@v2
# Audit
- name: Audit
run: |
nix flake update -- advisory-db
nix build -L .#ci.audit