0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-15 05:09:50 +00:00
libsql/.github/workflows/golang-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

82 lines
2.2 KiB
YAML

name: Go 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:
golang-bindings:
runs-on: ubuntu-latest
services:
sqld:
image: ghcr.io/tursodatabase/libsql-server:latest
ports:
- 8080:8080
steps:
- uses: actions/checkout@v3
# needed because we run out of disk space during tests
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# when set to "true" but frees about 6 GB
tool-cache: true
- uses: dtolnay/rust-toolchain@stable
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.21'
- name: get TCL
run: sudo apt-get install -y tcl8.6-dev
- 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 sql-experimental
run: cargo b -j16 --release -p sql-experimental
- name: go-libsql checkout
uses: actions/checkout@v3
with:
repository: tursodatabase/go-libsql
ref: "main"
path: "go-libsql"
- name: Copy sql-experimental library to go-libsql
run: cp target/release/libsql_experimental.a go-libsql/lib/darwin_amd64/
&& cp target/release/libsql_experimental.a go-libsql/lib/darwin_arm64/
&& cp target/release/libsql_experimental.a go-libsql/lib/linux_amd64/
&& cp target/release/libsql_experimental.a go-libsql/lib/linux_arm64/
&& cp bindings/c/include/libsql.h go-libsql/lib/include/
- name: Run go-libsql tests
working-directory: go-libsql
run: go test -v -count=1 ./...
env:
LIBSQL_PRIMARY_URL: "http://127.0.0.1:8080"