-
Notifications
You must be signed in to change notification settings - Fork 328
78 lines (63 loc) · 1.93 KB
/
c-bindings.yml
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
name: C bindings tests CI
on:
push:
branches: [ "main" ]
pull_request:
merge_group:
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
c-bundle-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Generate C bundle
run: cargo xtask build-bundled
- name: Check that C bundle is up to date
run: git diff --quiet || (echo "found uncommited changes in the bundle; please run 'cargo xtask build-bundled' and commit the result" && exit 1)
c-bindings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build crates
run: cargo build --release
- name: copy lib
working-directory: bindings/c
run: cp ../../target/release/libsql_experimental.a .
- name: clean rust
run: cargo clean
- name: Build C bindings example
working-directory: bindings/c
env:
LIBSQL_EXPERIMENTAL_PATH: libsql_experimental.a
run: make