-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.87 KB
/
Copy pathci.yml
File metadata and controls
66 lines (54 loc) · 1.87 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
name: CI
on:
push:
branches: [master, main]
pull_request:
env:
CARGO_TERM_COLOR: always
RAYFORCE_SRC: ${{ github.workspace }}/rayforce-core
RAYFORCE_Q_SRC: ${{ github.workspace }}/rayforce-q
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout bindings
uses: actions/checkout@v4
- name: Checkout RayforceDB core
uses: actions/checkout@v4
with:
repository: RayforceDB/rayforce
path: rayforce-core
- name: Checkout rayforce-q client
uses: actions/checkout@v4
with:
repository: RayforceDB/rayforce-q
path: rayforce-q
- name: Install toolchain deps
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev build-essential
# The repo's .cargo/config.toml sets a macOS LIBCLANG_PATH for local dev.
# On Linux that path is invalid, so point bindgen at the apt libclang here
# — an env var set in the job takes precedence over the config default.
- name: Locate libclang
run: |
LIB="$(find /usr/lib -name 'libclang*.so*' 2>/dev/null | head -1)"
if [ -z "$LIB" ]; then echo "libclang not found" >&2; exit 1; fi
echo "LIBCLANG_PATH=$(dirname "$LIB")" >> "$GITHUB_ENV"
echo "Using LIBCLANG_PATH=$(dirname "$LIB")"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --workspace