0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-15 07:29:41 +00:00
libsql/.github/workflows/c-bindings.yml
Sivukhin Nikita aaf42e3f29
cancel previous running actions if new commits are pushed (#1540)
* 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
2024-07-09 13:06:24 +00:00

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