Skip to content

fix: update ci.yml to build and test the example #4

fix: update ci.yml to build and test the example

fix: update ci.yml to build and test the example #4

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
env:
GOFLAGS: -mod=mod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24.2'
- name: Set DUCKDB_HOME environment variable
run: echo "DUCKDB_HOME=${{ runner.temp }}/duckdb-home" >> $GITHUB_ENV
- name: Set GOMODCACHE environment variable
run: echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Ensure DUCKDB_HOME exists
run: mkdir -p "${{ env.DUCKDB_HOME }}"
- name: Install system build deps
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config
- name: Run tests
run: |
# run all tests with verbose output
go test ./... -v
- name: Build and run examples
run: |
go build -o test example/*.go
./test