ci: move to Nix (simpler, easy to maintain version) #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: cargo fmt/clippy, 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 develop -L . --command "pre-commit run --all-files" | |
build-test: | |
name: Build, test, check Rust | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- "" # empty means default | |
- msrv | |
features: | |
- --no-default-features | |
- --all-features | |
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 | |
- name: build | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo build ${{ matrix.features }}" | |
- name: test | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo test ${{ matrix.features }}" | |
check-no-std: | |
name: Check no_std | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- "" # empty means default | |
- msrv | |
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 | |
# TODO "--target thumbv6m-none-eabi" should work but currently does not | |
- name: Check bdk_chain | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo check -p bdk_chain --no-default-features --features bitcoin/no-std,miniscript/no-std,hashbrown" | |
- name: Check bdk | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo check -p bdk --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown" | |
- name: Check esplora | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo check -p bdk_esplora --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown" | |
check-wasm: | |
name: Check WASM | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- "" # empty means default | |
- msrv | |
target: | |
- wasm32-unknown-unknown | |
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 | |
# TODO "--target thumbv6m-none-eabi" should work but currently does not | |
- name: Check bdk | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo check -p bdk --target ${{ matrix.target }} --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,dev-getrandom-wasm" | |
- name: Check esplora | |
run: nix develop -L ".#${{ matrix.rust }}" --command "cargo check -p bdk_esplora --target ${{ matrix.target }} --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,async" |