Skip to content

Commit aedcc91

Browse files
committed
ci: build with fresh rayforce checkout
1 parent 3475b96 commit aedcc91

3 files changed

Lines changed: 43 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout raysense
14+
uses: actions/checkout@v4
15+
16+
- name: Checkout rayforce
17+
uses: actions/checkout@v4
18+
with:
19+
repository: RayforceDB/rayforce
20+
path: deps/rayforce
21+
22+
- name: Build rayforce library
23+
run: make -C deps/rayforce lib
24+
25+
- name: Check formatting
26+
run: cargo fmt --check
27+
28+
- name: Run tests
29+
run: cargo test
30+
env:
31+
RAYFORCE_DIR: deps/rayforce

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
Cargo.lock
33
/local/
44
.codex
5+
/deps/rayforce/

crates/rayforce-sys/build.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ use std::path::PathBuf;
33

44
fn main() {
55
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
6-
let rayforce_dir = env::var_os("RAYFORCE_DIR")
7-
.map(PathBuf::from)
8-
.unwrap_or_else(|| manifest_dir.join("../../..").join("rayforce"));
6+
let repo_root = manifest_dir.join("../..");
7+
let checkout_dir = repo_root.join("deps/rayforce");
8+
let sibling_dir = repo_root.join("../rayforce");
9+
let rayforce_dir = env::var_os("RAYFORCE_DIR").map(PathBuf::from).unwrap_or({
10+
if checkout_dir.exists() {
11+
checkout_dir
12+
} else {
13+
sibling_dir
14+
}
15+
});
916

1017
let include_dir = rayforce_dir.join("include");
1118
let lib_dir = rayforce_dir.clone();
1219
let lib_path = lib_dir.join("librayforce.a");
1320

1421
if !lib_path.exists() {
1522
panic!(
16-
"missing {}; build it with `make -C {} lib` or set RAYFORCE_DIR",
23+
"missing {}; build Rayforce with `make -C {} lib` or set RAYFORCE_DIR",
1724
lib_path.display(),
1825
rayforce_dir.display()
1926
);

0 commit comments

Comments
 (0)