File tree 3 files changed +38
-7
lines changed
3 files changed +38
-7
lines changed Original file line number Diff line number Diff line change 30
30
echo "::add-mask::$NVA_API_URL"
31
31
export NVA_API_TOKEN=$(cat $GITHUB_EVENT_PATH | jq -r ".inputs.nva_token" )
32
32
echo "::add-mask::$NVA_API_TOKEN"
33
- make fetch-schema
34
33
- name : Build wasm
35
34
run : make build-wasm
36
35
- name : Build tokio
40
39
- name : Run tests
41
40
run : |
42
41
make test-tokio
43
- make generate-cbindgen-c
44
- make generate-cbindgen-cpp
45
- # make test-capi
Original file line number Diff line number Diff line change @@ -14,13 +14,12 @@ Documentation for [Python](https://navability.github.io/NavAbilitySDK.py/) or [J
14
14
15
15
## Compiling
16
16
17
- Get the schema with NVA_API_URL and NVA_API_TOKEN args/env var set:
17
+ Get deps
18
18
``` shell
19
19
make install-deps # modifies system cargo crates
20
- make fetch-schema
21
20
```
22
21
23
- Compile for either native or wasm:
22
+ Set required NVA_API_URL and NVA_API_TOKEN args/env variables and compile for either native or wasm:
24
23
``` shell
25
24
make build-wasm
26
25
make build-tokio
Original file line number Diff line number Diff line change
1
+
2
+ // build.rs
3
+
4
+ use std:: process:: Command ;
5
+ use std:: fs;
6
+
7
+ fn main ( ) {
8
+ let path = "src/schema.json" ;
9
+ match fs:: exists ( path) {
10
+ Ok ( e) => {
11
+ if e {
12
+ if 100 < fs:: metadata ( path) . unwrap ( ) . len ( ) {
13
+ println ! ( "cargo::warning=NavAbilitySDK.rs build did not update existing schema.json." ) ;
14
+ return ( ) ;
15
+ } else {
16
+ println ! ( "cargo::warning=NavAbilitySDK.rs build schema.json file is incomplete - trying to introspect again." ) ;
17
+ }
18
+ }
19
+ let mut fetchschema = Command :: new ( "sh" ) ;
20
+ fetchschema. arg ( "-c" ) . arg ( "make fetch-schema" ) ;
21
+ match fetchschema. output ( ) {
22
+ Ok ( o) => {
23
+ println ! ( "cargo::warning={}: {:?}" , "NavAbilitySDK.rs trying schema introspection (ensure env variables NVA_API_API/TOKEN)" , o) ;
24
+ }
25
+ Err ( e) => {
26
+ println ! ( "cargo::warning={} {:?}" , "NavAbilitySDK.rs build schema introspection failed with error:" , e) ;
27
+ }
28
+ }
29
+ }
30
+ Err ( e) => {
31
+ println ! ( "cargo::warning=NavAbilitySDK.rs build unable to check for src/schema.json: {:?}" , e) ;
32
+ }
33
+ }
34
+ // println!("cargo::rerun-if-changed=build.rs");
35
+ }
36
+
You can’t perform that action at this time.
0 commit comments