-
Notifications
You must be signed in to change notification settings - Fork 7
131 lines (104 loc) · 3.13 KB
/
Copy pathcheck_rust.yml
File metadata and controls
131 lines (104 loc) · 3.13 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
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
name: Rust checks
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: x86_64-unknown-linux-gnu
- run: cargo test
check-rustfmt:
name: Check Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install toolchain
run: |
rustup install
rustup component add rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: x86_64-unknown-linux-gnu
- name: Check Rust formatting
run: cargo fmt --all -- --check
check-clippy:
name: Check, Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Must happen /after/ the checkout step, to pick up the toolchain
# from the `rust-toolchain.toml` file.
- name: Install toolchain
run: |
rustup install
rustup component add clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: x86_64-unknown-linux-gnu
- name: Cargo check
run: cargo check --all-targets
- name: Clippy
run: |
cargo clippy --all-targets
check-unused-deps:
name: Check unused deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo-shear
run: cargo binstall --no-confirm cargo-shear
- name: Check for unused dependencies
run: cargo shear --deny-warnings
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: x86_64-unknown-linux-gnu
# Caches bitcoind across CI runs so we don't re-download it every time.
# Keyed on the script (which pins the version) and OS.
- name: Cache integration-test deps
id: cache-deps
uses: actions/cache@v6
with:
path: .integration-deps
key: integration-deps-${{ runner.os }}-${{ hashFiles('scripts/setup_integration_tests.sh') }}
- name: Set up bitcoind and integrationtests.env
run: ./scripts/setup_integration_tests.sh
- name: Build integration_tests binary
run: cargo build --bin integration_tests
- name: Run integration tests
env:
CUSF_TEST_ARTIFACTS_DIR: ${{ runner.temp }}/test-artifacts
run: |
set -a
source ./integrationtests.env
set +a
cargo run --bin integration_tests -- --test-threads=1
- name: Upload integration test logs
if: failure()
uses: actions/upload-artifact@v7
with:
name: integration-test-logs
path: ${{ runner.temp }}/test-artifacts/
retention-days: 14
if-no-files-found: ignore