Repository navigation
104 lines (98 loc) · 3.18 KB
/
Copy pathexamples-rust-ci.yml
File metadata and controls
104 lines (98 loc) · 3.18 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
name: Rust examples CI
on:
push:
branches: [main]
paths:
- "examples/rust/**"
- "examples/entity-store/**"
- ".github/workflows/examples-rust-ci.yml"
pull_request:
paths:
- "examples/rust/**"
- "examples/entity-store/**"
- ".github/workflows/examples-rust-ci.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: examples-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: Published SDK, format, Clippy, and tests
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: examples/rust
steps:
- uses: actions/checkout@v7
- name: Install Rust
run: rustup toolchain install 1.97.1 --profile minimal --component rustfmt,clippy
- name: Verify published SDK dependency
run: |
set -euo pipefail
cargo tree --locked -p dex-sdk | tee /tmp/dex-examples-rust-sdk-tree.txt
grep -qE '^dex-sdk v[0-9]' /tmp/dex-examples-rust-sdk-tree.txt
if grep -q '(/' /tmp/dex-examples-rust-sdk-tree.txt; then
echo "examples/rust must depend on published dex-sdk, not a path dependency"
exit 1
fi
- name: Check formatting
run: make fmt-check
- name: Run Clippy
run: make clippy
- name: Run catalog integration tests
run: make test
integ:
name: Integration tests with dexcli dev (pull, zd)
runs-on: ubuntu-latest
timeout-minutes: 45
env:
DEX_INTEG_ENGINE: zd
DEX_SERVER_ZD_BINARY: ${{ github.workspace }}/server-zd/target/debug/dex-server-zd
# With the workflow env, these match Server ZD CI, so its main cache restores here.
CARGO_INCREMENTAL: "0"
CARGO_BUILD_JOBS: "4"
defaults:
run:
working-directory: examples/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
# Restore-only: the Server ZD CI ParadeDB job owns this key.
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: Integration tests with dexcli dev
run: ./run-integration-tests.sh
- name: Upload service logs
if: always()
uses: actions/upload-artifact@v7
with:
name: rust-examples-integration-services-zd
path: /tmp/test-rust-examples-integration-services.log
if-no-files-found: ignore