mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-15 07:29:41 +00:00
aaf42e3f29
* cancel previous running actions if new commits are pushed * cancel-in-progress for rust tests * cancel-in-progress for c-bindings workflow * cancel-in-progress for test GitHub actions
79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
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
|