Repository navigation
145 lines (138 loc) · 4.02 KB
/
Copy pathsdk-rust-ci.yml
File metadata and controls
145 lines (138 loc) · 4.02 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
name: Rust SDK CI
on:
push:
branches: [main]
paths:
- "sdk-rust/**"
- "cli/**"
- "server-zd/**"
- "s3local/**"
- "protos/**"
- "web/**"
- "codecov.yml"
- ".github/workflows/sdk-rust-ci.yml"
pull_request:
paths:
- "sdk-rust/**"
- "cli/**"
- "server-zd/**"
- "s3local/**"
- "protos/**"
- "web/**"
- "codecov.yml"
- ".github/workflows/sdk-rust-ci.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sdk-rust-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
RUSTUP_TOOLCHAIN: "1.97.1"
jobs:
quality:
name: Format and Clippy
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: sdk-rust
steps:
- uses: actions/checkout@v7
- name: Install Rust
run: rustup toolchain install 1.97.1 --profile minimal --component rustfmt,clippy
- name: Check formatting
run: cargo fmt --all --check
- name: Validate public API documentation
run: make docs-check
- name: Run Clippy
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
tests:
name: Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
working-directory: sdk-rust
steps:
- uses: actions/checkout@v7
- name: Install Rust
run: rustup toolchain install 1.97.1 --profile minimal
- name: Run tests
run: cargo test --workspace --locked
integration:
name: Integration coverage (zd, pull)
runs-on: ubuntu-latest
timeout-minutes: 75
permissions:
contents: read
id-token: write
env:
DEX_INTEG_ENGINE: zd
DEX_SERVER_ZD_BINARY: ${{ github.workspace }}/server-zd/target/debug/dex-server-zd
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
RUST_BACKTRACE: "1"
RUSTUP_TOOLCHAIN: "1.97.1"
CARGO_BUILD_JOBS: "4"
defaults:
run:
working-directory: sdk-rust
steps:
- uses: actions/checkout@v7
- name: Install Rust
run: rustup toolchain install 1.97.1 --profile minimal
- name: Install libclang for RocksDB
run: sudo apt-get update && sudo apt-get install -y libclang-dev
- uses: Swatinem/rust-cache@v2
with:
workspaces: server-zd
shared-key: server-zd-paradedb
save-if: false
- name: Build dex-server-zd
working-directory: server-zd
run: cargo build --locked -p dexzd-server --bin dex-server-zd
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json
- uses: actions/setup-go@v7
with:
go-version-file: cli/go.mod
cache-dependency-path: |
cli/go.sum
web/go.sum
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run integration coverage
run: ./run-integration-tests.sh --coverage
- name: Upload Rust integration coverage to Codecov
uses: codecov/codecov-action@v5
with:
disable_search: true
fail_ci_if_error: true
files: ./sdk-rust/coverage/lcov.info
flags: sdk-rust-integration-pull
name: sdk-rust-integration-pull
use_oidc: true
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: sdk-rust-integration-coverage-pull
path: sdk-rust/coverage/
if-no-files-found: ignore
- name: Upload service logs
if: always()
uses: actions/upload-artifact@v7
with:
name: sdk-rust-integration-services-pull
path: /tmp/test-rust-sdk-integration-services.log
if-no-files-found: ignore