-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (112 loc) · 3.79 KB
/
ci.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
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
name: CI
on: push
jobs:
fmt_and_clippy:
name: Fmt and clippy
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Fmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy -- -D warnings
- name: Clippy all
run: cargo clippy --all-targets --all-features --all -- -D warnings
erc20_processor:
name: ERC20 processor build only
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Build erc20 processor
run: cargo build --profile=release-lto
build_tests_and_cache:
name: Build and cache all tests
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
profile: [release-fast, release-lto, dev]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "test-cache-${{ matrix.profile }}"
- name: Build tests
run: cargo test --profile=${{ matrix.profile }} --test custom_long --no-run
payment_tests:
name: Payment tests (basic + short ones)
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "test-cache-release-fast"
save-if: false
- name: Build tests
run: cargo test --profile=release-fast --no-run
- name: Run tests (docker_01_basic)
run: cargo test --test docker_01_basic --profile=release-fast -- --test-threads=10
- name: Run tests (docker_02_errors)
run: cargo test --test docker_02_errors --profile=release-fast -- --test-threads=10
- name: Run tests (docker_04_multi)
run: cargo test --test docker_04_multi --profile=release-fast -- --test-threads=10
payment_tests_multi:
name: Payment tests (multi)
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "test-cache-release-fast"
save-if: false
- name: Build tests
run: cargo test --profile=release-fast --no-run
- name: Run tests (docker_03_problems)
run: cargo test --test docker_03_problems --profile=release-fast -- --test-threads=10
payment_tests_custom:
name: Payment tests (custom)
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: "test-cache-release-fast"
save-if: false
- name: Build tests
run: cargo test --profile=release-fast --no-run
- name: Run test custom (200 transfers)
run: cargo test --profile=release-fast --test custom_long -- --test-threads=1
env:
ERC20_TESTS_USE_DISK_DB: 1
ERC20_TESTS_OVERRIDE_DB_NAME: erc20lib.sqlite
ERC20_LIB_SQLITE_JOURNAL_MODE: wal
ERC20_TEST_RECEIVER_POOL_SIZE: 300
ERC20_TEST_MAX_IN_TX: 15
ERC20_TEST_TRANSFER_COUNT: 200
ERC20_TEST_TRANSFER_INTERVAL: 0.1
- name: Reopen db cleaning wal logs
run: cargo run --profile=release-fast -- --sqlite-db-file erc20lib.sqlite --sqlite-journal delete cleanup
- uses: actions/upload-artifact@v3
with:
name: erc20lib_custom
path: erc20lib.sqlite