Skip to content

Commit

Permalink
sql-experimental: add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pjhades committed Nov 9, 2023
1 parent 490f7f7 commit afd9638
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/c-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: C bindings tests CI

on:
push:
branches: [ "main" ]
pull_request:
merge_group:
branches: [ "main" ]

jobs:
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

- name: Build C bindings example
working-directory: bindings/c
run: make
13 changes: 13 additions & 0 deletions bindings/c/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
OS := $(shell uname)
CFLAGS := -Iinclude
LDFLAGS := -lm

ifeq ($(OS),Darwin)
CFLAGS += -framework Security -framework CoreServices
endif

.PHONY: all
all: example

example: example.c
$(CC) -o $@ $(CFLAGS) $< ../../target/debug/libsql_experimental.a $(LDFLAGS)

0 comments on commit afd9638

Please sign in to comment.