-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (157 loc) · 5.05 KB
/
rust.yml
File metadata and controls
159 lines (157 loc) · 5.05 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
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
on:
push:
branches:
- master
pull_request:
env:
CARGO_TERM_COLOR: always
POSTGRES_USER: dlcdevkit
POSTGRES_PASS: dlcdevkit
DATABASE_URL: postgresql://dlcdevkit:dlcdevkit@localhost:5432/postgres
BITCOIND_HOST: http://localhost:18443
BITCOIND_USER: dlcdevkit
BITCOIND_PASS: dlcdevkit
ESPLORA_HOST: http://localhost:30000
RPC_WALLET: ddk
jobs:
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.89.0
components: clippy
override: true
- name: Check clippy
run: cargo clippy -- -D warnings
format:
name: format
runs-on: ubuntu-latest
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
override: true
- name: Check format
run: cargo fmt --check
check:
name: check
runs-on: ubuntu-latest
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.88.0
override: true
- name: cargo check
run: cargo check --all-features
unit-tests:
name: unit tests
runs-on: ubuntu-latest
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.88.0
components: rustfmt
override: true
- name: Start Docker Compose services
run: docker compose up -d
- name: Wait for Bitcoin container
run: |
chmod +x ./testconfig/scripts/wait_for_container.sh
./testconfig/scripts/wait_for_container.sh bitcoin
- name: Wait for Electrs to be ready
run: |
chmod +x ./testconfig/scripts/wait_for_electrs.sh
./testconfig/scripts/wait_for_electrs.sh
- name: Run unit tests
run: cargo test --all-features
- name: Stop Docker Compose services
if: always()
run: docker compose down -v
integration_tests_prepare:
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.88.0
components: rustfmt
override: true
- uses: actions/cache@v3
env:
cache-name: test-cache
with:
path: target/debug/deps
key: test-cache-${{ github.run_id }}-${{ github.run_number }}
- uses: actions/checkout@v4
- id: set-matrix
run: cargo test --no-run --all-features && echo "::set-output name=matrix::$(testconfig/scripts/get_test_list.sh manager_execution manager_tests contract_updater)"
integration_tests:
name: integration tests
needs: integration_tests_prepare
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
tests: ${{ fromJson(needs.integration_tests_prepare.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
env:
cache-name: test-cache
with:
path: target/debug/deps
key: test-cache-${{ github.run_id }}-${{ github.run_number }}
- name: Start bitcoin node
run: docker compose up -d
- name: Wait for container to run
run: |
chmod +x ./testconfig/scripts/wait_for_container.sh
./testconfig/scripts/wait_for_container.sh bitcoin
- name: Wait for electrs to be ready
run: |
chmod +x ./testconfig/scripts/wait_for_electrs.sh
./testconfig/scripts/wait_for_electrs.sh
- name: Run test
run: RUST_BACKTRACE=1 RUST_MIN_STACK=8388608 ${{ matrix.tests }} --ignored
- name: Stop bitcoin node
run: docker compose down -v
test_splicing:
name: test splicing
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Start bitcoin node
run: docker compose up -d
- name: Wait for container to run
run: |
chmod +x ./testconfig/scripts/wait_for_container.sh
./testconfig/scripts/wait_for_container.sh bitcoin
- name: Wait for electrs to be ready
run: |
chmod +x ./testconfig/scripts/wait_for_electrs.sh
./testconfig/scripts/wait_for_electrs.sh
- name: Run test
run: RUST_MIN_STACK=8388608 cargo test -p ddk-manager splice -- --nocapture --ignored
- name: Stop bitcoin node
run: docker compose down -v