forked from RGB-WG/rgb-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.78 KB
/
checks.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
62
63
64
65
66
67
68
69
70
name: Code checks
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Lint
run: cargo clippy --all-targets -- -D warnings
format:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Format
run: cargo fmt --all -- --check
test_and_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: llvm-tools-preview
toolchain: stable
- name: Install llvm-cov
env:
LLVM_COV_RELEASES: https://github.com/taiki-e/cargo-llvm-cov/releases
run: |
host=$(rustc -Vv | grep host | sed 's/host: //')
curl -fsSL $LLVM_COV_RELEASES/latest/download/cargo-llvm-cov-$host.tar.gz | tar xzf - -C "$HOME/.cargo/bin"
- name: Test and generate coverage report
run: |
INDEXER=esplora cargo llvm-cov --output-path coverage.lcov
INDEXER=electrum cargo llvm-cov --no-clean --output-path coverage.lcov
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: coverage.lcov
flags: rust
token: ${{ secrets.CODECOV_TOKEN }}