-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (94 loc) · 3.39 KB
/
Copy pathci.yml
File metadata and controls
115 lines (94 loc) · 3.39 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
# sccache requires incremental compilation to be disabled.
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"
# Compilation caching via sccache, backed by a node-local hostPath mounted at
# /opt/sccache. The dir persists across the ephemeral ARC runner pods, so each
# job only recompiles crates whose inputs changed. run-in-rust-container.sh
# bind-mounts SCCACHE_DIR into the rust container and forwards these vars.
RUSTC_WRAPPER: sccache
SCCACHE_DIR: /opt/sccache
# Cap on-disk cache size to protect host storage.
SCCACHE_CACHE_SIZE: 20G
CHDB_RUST_REPO: https://github.com/hyperbyte-cloud/chdb-rust.git
CHDB_RUST_REF: main
jobs:
doc_links:
name: Doc links (relative .md)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Check relative markdown links
run: python3 scripts/check_doc_links.py
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout chdb-rust
run: bash .github/scripts/checkout-chdb-rust.sh
- name: Install CI dependencies
uses: ./.github/actions/install-ci-deps
with:
profile: k8s-runner
- name: Check formatting
run: |
bash .github/scripts/run-in-rust-container.sh \
'rustup component add rustfmt && RUSTC_WRAPPER= cargo fmt --check'
clippy:
name: Clippy
runs-on: ubuntu-latest
needs: [fmt, doc_links]
steps:
- uses: actions/checkout@v4
- name: Checkout chdb-rust
run: bash .github/scripts/checkout-chdb-rust.sh
- name: Install CI dependencies
uses: ./.github/actions/install-ci-deps
with:
profile: k8s-runner
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: |
bash .github/scripts/run-in-rust-container.sh \
'bash .github/scripts/rust-container-setup.sh && rustup component add clippy && sccache --zero-stats && cargo build --all-targets && cargo clippy --all-targets --no-deps -- -D warnings && sccache --show-stats'
test:
name: Test
runs-on: ubuntu-latest
# Run after Clippy so node-local sccache and rust-cache are warm. When Test
# started in parallel with Clippy it always saw 0% sccache hits because
# Clippy had not finished writing the cache yet (and rust-cache had not saved).
needs: [clippy]
steps:
- uses: actions/checkout@v4
- name: Checkout chdb-rust
run: bash .github/scripts/checkout-chdb-rust.sh
- name: Install CI dependencies
uses: ./.github/actions/install-ci-deps
with:
profile: k8s-runner
- uses: Swatinem/rust-cache@v2
# Single container session: one rust-container-setup, shared target/ and
# sccache across all test suites (avoids three cold docker runs).
- name: Run tests
run: |
bash .github/scripts/run-in-rust-container.sh \
'bash .github/scripts/rust-container-setup.sh && \
sccache --zero-stats && \
cargo test --lib && \
cargo test --test '"'"'*'"'"' && \
cargo test -p hyperbytedb-cli && \
sccache --show-stats'