-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (148 loc) · 4.36 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
156
157
name: CI # Continuous Integration
on:
push:
branches:
- master
merge_group:
pull_request:
branches:
- "**"
paths:
- "Cargo.toml"
- "Cargo.lock"
- "**.rs"
- ".github**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} # cancels previous runs on the same PR / commit group
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rustfmt
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: extractions/setup-just@v2
- name: Check formatting
run: just check_format
clippy:
name: Clippy
needs: rustfmt
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
- name: Install Clang
run: sudo apt-get update && sudo apt-get install -y clang
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: extractions/setup-just@v2
- name: Clippy check
run: just lint
test:
name: Test with codecov
runs-on: [self-hosted, linux]
needs: rustfmt
steps:
- uses: actions/checkout@v3
- name: Install Clang
run: sudo apt-get update && sudo apt-get install -y clang
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: extractions/setup-just@v2
- name: Run tests
env:
RUSTC_WRAPPER: scripts/coverage.py
RUST_LOG: warn
run: just test_cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: github.repository == 'broxus/tycho'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
integration-test:
name: Integration Test Suite
runs-on: [self-hosted, linux]
needs: rustfmt
steps:
- uses: actions/checkout@v3
- name: Install Clang
run: sudo apt-get update && sudo apt-get install -y clang
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: extractions/setup-just@v2
- name: Run integration tests
env:
RUST_LOG: warn
run: just run_integration_tests
metrics:
name: Metrics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: extractions/setup-just@v2
- name: Check dashboard
run: just check_dashboard
msrv:
name: Check minimum supported Rust version
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Check semver
run: cargo msrv verify --manifest-path cli/Cargo.toml
check-protos:
name: Check protos
if: |
contains(github.event.pull_request.files.*.path, '.proto') ||
(github.event_name == 'push' && contains(join(github.event.commits.*.added, github.event.commits.*.modified), '.proto'))
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install protobuf
run: sudo apt update && sudo apt-get -y install protobuf-compiler
- uses: extractions/setup-just@v2
- name: Update RPC proto
run: just update_rpc_proto
- name: Check for uncommitted changes
run: git diff --exit-code
# docs:
# name: Docs
# needs: clippy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install Clang
# run: sudo apt-get update && sudo apt-get install -y clang
# - uses: dtolnay/rust-toolchain@stable
# - uses: Swatinem/rust-cache@v2
# - uses: extractions/setup-just@v2
# - name: Check documentation
# run: just docs