on: [push, pull_request] name: Continuous integration jobs: test: name: Test Default runs-on: ubuntu-latest strategy: matrix: rust: - stable - 1.45.0 # MSRV steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} override: true - uses: actions-rs/cargo@v1 with: command: check - uses: actions-rs/cargo@v1 with: command: test check-features: name: Check Features runs-on: ubuntu-latest strategy: matrix: features: - minimal - all-keys - minimal,esplora - key-value-db - electrum - compact_filters - cli-utils,esplora steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: 1.45.0 # MSRV override: true - uses: actions-rs/cargo@v1 with: command: check args: --features ${{ matrix.features }} --no-default-features test-compiler: name: Test Compiler runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: 1.45.0 # MSRV override: true - uses: actions-rs/cargo@v1 with: command: test args: --features compiler --no-default-features test-electrum: name: Test Electrum runs-on: ubuntu-16.04 env: MAGICAL_RPC_COOKIEFILE: /home/runner/.bitcoin/regtest/.cookie MAGICAL_ELECTRUM_URL: tcp://127.0.0.1:60401 steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: 1.45.0 # MSRV override: true - run: ./ci/start-core.sh || exit 1 - uses: actions-rs/cargo@v1 with: command: test args: --features test-electrum --no-default-features test-md-docs: name: Test MD Docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: nightly override: true - uses: actions-rs/cargo@v1 with: command: test args: --features test-md-docs --no-default-features check-wasm: name: Check WASM runs-on: ubuntu-16.04 env: CC: clang-10 CFLAGS: -I/usr/include steps: - uses: actions/checkout@v2 - uses: actions/cache@v2 with: path: | ~/.cargo/registry ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} # Install a recent version of clang that supports wasm32 - run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1 - run: sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" || exit 1 - run: sudo apt-get update || exit 1 - run: sudo apt-get install -y clang-10 libc6-dev-i386 || exit 1 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: 1.45.0 # MSRV target: wasm32-unknown-unknown override: true - uses: actions-rs/cargo@v1 with: command: check args: --target wasm32-unknown-unknown --features cli-utils,esplora --no-default-features fmt: name: Rustfmt runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: 1.45.0 # MSRV override: true components: rustfmt - uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check # TODO enable this after existing clippy warnings are fixed # clippy: # name: Clippy # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v2 # - uses: actions-rs/toolchain@v1 # with: # profile: minimal # toolchain: 1.45.0 # MSRV # override: true # components: clippy # - uses: actions-rs/cargo@v1 # with: # command: clippy # args: -- -D warnings