Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 68 additions & 31 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ on:
workflow_call:

jobs:
build-wasm-node:
name: Build WASM (Node target)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install wasm-pack
run: curl -sSfL https://github.com/rustwasm/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C /usr/local/bin --strip-components=1 wasm-pack-v0.14.0-x86_64-unknown-linux-musl/wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "wasm-node"
- name: Build WASM (Node target)
run: wasm-pack build --target nodejs --all-features
- name: Upload WASM artifact
uses: actions/upload-artifact@v4
with:
name: wasm-node-pkg
path: pkg/
retention-days: 1

build-test:
name: Build and test - Browser
runs-on: ubuntu-latest
Expand All @@ -17,15 +39,15 @@ jobs:
- debug,esplora
steps:
- name: checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
- name: Install wasm-pack
run: curl -sSfL https://github.com/rustwasm/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C /usr/local/bin --strip-components=1 wasm-pack-v0.14.0-x86_64-unknown-linux-musl/wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@401aff9a7a08acb9d27b64936a90db81024cff97 # v2.8.2
uses: Swatinem/rust-cache@v2
- name: Build
run: |
if [ "${{ matrix.features }}" = "all" ]; then
Expand All @@ -40,18 +62,22 @@ jobs:
build-lint-test-node:
name: Build, Lint and test - Node
runs-on: ubuntu-latest
needs: build-wasm-node
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Install wasm-pack
run: curl -sSfL https://github.com/rustwasm/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C /usr/local/bin --strip-components=1 wasm-pack-v0.14.0-x86_64-unknown-linux-musl/wasm-pack
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn
cache-dependency-path: tests/node/yarn.lock
- name: Download WASM artifact
uses: actions/download-artifact@v4
with:
name: wasm-node-pkg
path: pkg/
- name: Install
working-directory: tests/node
run: yarn install --immutable
Expand All @@ -60,31 +86,44 @@ jobs:
run: yarn lint
- name: Test
working-directory: tests/node
run: yarn build && yarn jest --testPathIgnorePatterns='integration/(esplora|events)'
run: yarn jest --testPathIgnorePatterns='integration/(esplora|events)'

esplora-integration:
name: Esplora integration tests
runs-on: ubuntu-latest
needs: build-wasm-node
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Install wasm-pack
run: curl -sSfL https://github.com/rustwasm/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C /usr/local/bin --strip-components=1 wasm-pack-v0.14.0-x86_64-unknown-linux-musl/wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@401aff9a7a08acb9d27b64936a90db81024cff97 # v2.8.2
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn
cache-dependency-path: tests/node/yarn.lock
- name: Install dependencies
working-directory: tests/node
run: yarn install --immutable
- name: Build WASM (Node target)
working-directory: tests/node
run: yarn build
- name: Download WASM artifact
uses: actions/download-artifact@v4
with:
name: wasm-node-pkg
path: pkg/
- name: Cache Esplora Docker image
id: cache-esplora
uses: actions/cache@v4
with:
path: /tmp/esplora-image.tar
key: esplora-docker-${{ hashFiles('tests/docker-compose.yml') }}
- name: Load Esplora image from cache
if: steps.cache-esplora.outputs.cache-hit == 'true'
run: docker load -i /tmp/esplora-image.tar
- name: Pull and save Esplora image
if: steps.cache-esplora.outputs.cache-hit != 'true'
run: |
docker pull blockstream/esplora
docker save blockstream/esplora -o /tmp/esplora-image.tar
- name: Start Esplora regtest
run: docker compose -f tests/docker-compose.yml up -d
- name: Wait for Esplora
Expand Down Expand Up @@ -115,26 +154,25 @@ jobs:
name: Signet smoke test (main only)
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build-wasm-node
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Install wasm-pack
run: curl -sSfL https://github.com/rustwasm/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C /usr/local/bin --strip-components=1 wasm-pack-v0.14.0-x86_64-unknown-linux-musl/wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@401aff9a7a08acb9d27b64936a90db81024cff97 # v2.8.2
- name: Setup Node
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: yarn
cache-dependency-path: tests/node/yarn.lock
- name: Install dependencies
working-directory: tests/node
run: yarn install --immutable
- name: Build WASM (Node target)
working-directory: tests/node
run: yarn build
- name: Download WASM artifact
uses: actions/download-artifact@v4
with:
name: wasm-node-pkg
path: pkg/
- name: Run Mutinynet signet tests
working-directory: tests/node
run: yarn jest --testPathPatterns='integration/esplora'
Expand All @@ -144,15 +182,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@401aff9a7a08acb9d27b64936a90db81024cff97 # v2.8.2
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --config format_code_in_doc_comments=true --check
- name: Run Clippy
run: cargo clippy --all-features --all-targets -- -D warnings
run: cargo clippy --all-features --all-targets -- -D warnings