-
-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (58 loc) · 1.74 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
on:
pull_request:
branches:
- main
name: CI
jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.74.0 # MSRV
features:
- all
- debug,default
- debug,esplora
- debug,snap
- debug,bitcoind
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: cargo install wasm-pack
- 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 --safari --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