-
Notifications
You must be signed in to change notification settings - Fork 21
165 lines (127 loc) · 4.66 KB
/
rust.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Rust
on:
- push
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check Formatting
run: cargo fmt --all -- --check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
components: clippy
- uses: olix0r/cargo-action-fmt/setup@v2
- uses: Swatinem/rust-cache@v2
- name: Lint src
run: cargo clippy --locked --all-features --lib --message-format=json -- -D warnings | cargo-action-fmt
- name: Lint tests
run: cargo clippy --locked --all-features --tests --message-format=json -- -D warnings | cargo-action-fmt
env:
TEST_WALLET_SEED: ""
lint-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
components: clippy
- uses: olix0r/cargo-action-fmt/setup@v2
- uses: jetli/[email protected]
- uses: Swatinem/rust-cache@v2
- name: Add wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: Lint src (wasm32)
run: cargo clippy --locked --target wasm32-unknown-unknown --lib --message-format=json -- -D warnings | cargo-action-fmt
- name: Lint tests (wasm32)
run: cargo clippy --locked --target wasm32-unknown-unknown --tests --message-format=json -- -D warnings | cargo-action-fmt
env:
TEST_WALLET_SEED: ""
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
components: clippy, rustfmt
# - uses: Swatinem/rust-cache@v2
- name: Up Bitcoin Node & RGB Proxy
run: |
docker compose up -d node1 rgb-proxy
- name: Setup Bitcoin Node
run: |
sleep 5
docker-compose exec -T node1 cli loadwallet default
docker-compose exec -T node1 cli -generate 500
docker-compose exec -T node1 cli sendtoaddress $MAIN_VAULT_ADDRESS 10
docker-compose exec -T node1 cli sendtoaddress $MAIN_VAULT_ADDRESS 10
docker-compose exec -T node1 cli sendtoaddress $MAIN_VAULT_ADDRESS 10
docker-compose exec -T node1 cli -generate 1
env:
MAIN_VAULT_ADDRESS: ${{ secrets.MAIN_VAULT_ADDRESS }}
RUST_BACKTRACE: 1
- name: RGB Test Init
run: cargo test --locked --features server --test _init -- _init --nocapture --test-threads 1
- name: RGB Tests
run: cargo test --locked --features server --test rgb -- rgb --nocapture --test-threads 1
env:
TEST_WALLET_SEED: ${{ secrets.TEST_WALLET_SEED }}
RUST_BACKTRACE: 1
- name: Wallet, LN & Payjoin Tests
run: cargo test --locked -- --skip rgb --test-threads 1 --nocapture
env:
TEST_WALLET_SEED: ${{ secrets.TEST_WALLET_SEED }}
RUST_BACKTRACE: 1
test-wasm:
runs-on: ubuntu-latest
needs: lint-wasm
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
# - uses: Swatinem/rust-cache@v2
- uses: jetli/[email protected]
- name: Up Bitcoin Node & RGB Proxy
run: |
docker compose up -d node1 rgb-proxy
- name: Setup Bitcoin Node
run: |
sleep 5
docker-compose exec -T node1 cli loadwallet default
docker-compose exec -T node1 cli -generate 500
docker-compose exec -T node1 cli sendtoaddress $MAIN_VAULT_ADDRESS 10
docker-compose exec -T node1 cli sendtoaddress $RGB_VAULT_ADDRESS 10
docker-compose exec -T node1 cli -generate 1
env:
MAIN_VAULT_ADDRESS: ${{ secrets.MAIN_VAULT_ADDRESS }}
RGB_VAULT_ADDRESS: ${{ secrets.RGB_VAULT_ADDRESS }}
RUST_BACKTRACE: 1
- name: Run bitmaskd node
run: cargo run --locked --features server & sleep 1
- name: Test WASM
run: wasm-pack test --headless --chrome
env:
TEST_WALLET_SEED: ${{ secrets.TEST_WALLET_SEED }}
WASM_BINDGEN_TEST_TIMEOUT: 240
RUST_BACKTRACE: 1