-
Notifications
You must be signed in to change notification settings - Fork 68
68 lines (55 loc) · 1.92 KB
/
rust.yml
File metadata and controls
68 lines (55 loc) · 1.92 KB
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
name: Rust
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Cache Bitcoin Core
id: cache-bitcoin
uses: actions/cache@v5
with:
path: /usr/local/bin/bitcoind
key: bitcoin-core-0.29.3
- name: Download and Install Bitcoin Core
if: steps.cache-bitcoin.outputs.cache-hit != 'true'
run: |
wget --quiet https://bitcoincore.org/bin/bitcoin-core-29.3/bitcoin-29.3-x86_64-linux-gnu.tar.gz
tar -xvf bitcoin-29.3-x86_64-linux-gnu.tar.gz
sudo mv bitcoin-29.3/bin/bitcoind /usr/local/bin/
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Set variables
run: |
echo "TOOLCHAIN=$(rustup show active-toolchain | cut -d ' ' -f1)" >> $GITHUB_ENV
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{ env.TOOLCHAIN }}
components: rustfmt, clippy, rust-docs
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Cache cargo install binaries
uses: actions/cache@v5
id: cargo-bin-cache
with:
path: ~/.cargo/bin/electrs
key: ${{ runner.os }}-cargo-bin-electrs-6d182d8d0801a40c44a26000ae731a38c1d96218
- name: Install Electrs
if: steps.cargo-bin-cache.outputs.cache-hit != 'true'
run: cargo install --git https://github.com/blockstream/electrs --rev 6d182d8d0801a40c44a26000ae731a38c1d96218 --bin electrs
- name: Format check
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --tests --all-features
env:
RUSTFLAGS: "-D warnings"
- name: Run tests
run: cargo test --workspace --all-features