fix: ci #22
Workflow file for this run
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: | |
pull_request: | |
branches: | |
- main | |
name: CI | |
jobs: | |
build-test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- 1.73.0 # MSRV | |
features: | |
- all | |
- debug,default | |
- debug,esplora | |
- debug,snap | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Install wasm-pack | |
run: curl https://raw.githubusercontent.com/rustwasm/wasm-pack/a3a48401795cd4b3afe1d74568c93675a04f3970/installer/init.sh -sSf | sh -s -- -f | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab | |
- name: Build | |
run: | | |
if [ "${{ matrix.features }}" = "all" ]; then | |
wasm-pack build --all-features | |
else | |
wasm-pack build --features ${{ matrix.features }} | |
fi | |
- name: Test | |
if: ${{ matrix.features != 'all' }} | |
run: wasm-pack test --chrome --firefox --headless --features ${{ matrix.features }} | |
lint: | |
name: Lint (fmt + clippy) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@4f647fc679bcd3b11499ccb42104547c83dabe96 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab | |
- 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 |