123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- name: CI
- on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
- env:
- CARGO_TERM_COLOR: always
- jobs:
- fmt:
- name: Format
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - run: cargo fmt --all -- --config format_code_in_doc_comments=true --check
- build:
- name: Build
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - version: stable
- build-args:
- [
- -p cdk,
- -p cdk --no-default-features,
- -p cdk --no-default-features --features wallet,
- -p cdk --no-default-features --features mint,
- -p cdk-redb,
- -p cdk-sqlite,
- -p cdk-axum,
- -p cdk-cln,
- -p cdk-fake-wallet,
- -p cdk-strike,
- -p cdk-lnbits
- -p cdk-integration-tests,
- --bin cdk-cli,
- --bin cdk-mintd,
- ]
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Cache
- uses: actions/cache@v3
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- target
- key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- - name: Set default toolchain
- run: rustup default ${{ matrix.rust.version }}
- - name: Set profile
- run: rustup set profile minimal && rustup component add clippy
- - name: Build
- run: cargo build ${{ matrix.build-args }}
- - name: Clippy
- run: cargo clippy ${{ matrix.build-args }} -- -D warnings
- build-wasm:
- name: Build WASM
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - version: stable
- build-args:
- [
- -p cdk,
- -p cdk --no-default-features,
- -p cdk --no-default-features --features wallet,
- -p cdk-js
- ]
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Cache
- uses: actions/cache@v3
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- target
- key: ${{ runner.os }}-cargo-wasm32-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- - name: Set default toolchain
- run: rustup default ${{ matrix.rust.version }}
- - name: Add WASM
- run: rustup target add wasm32-unknown-unknown
- - name: Set profile
- run: rustup set profile minimal && rustup component add clippy
- - name: Build
- run: cargo build ${{ matrix.build-args }} --target wasm32-unknown-unknown
- - name: Clippy
- run: cargo clippy ${{ matrix.build-args }} --target wasm32-unknown-unknown -- -D warnings
- run-examples:
- name: Run Examples
- runs-on: ubuntu-latest
- strategy:
- matrix:
- rust:
- - version: stable
- build-args:
- [
- mint-token,
- p2pk,
- proof-selection,
- wallet
- ]
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Cache
- uses: actions/cache@v3
- with:
- path: |
- ~/.cargo/registry
- ~/.cargo/git
- target
- key: ${{ runner.os }}-cargo-wasm32-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- - name: Set default toolchain
- run: rustup default ${{ matrix.rust.version }}
- - name: Run
- run: cargo run --example ${{ matrix.build-args }}
|