ci: add native library CI workflow
Some checks failed
Checkout test / test (push) Waiting to run
Documentation / build-and-publish (push) Waiting to run
CI with Native Libraries / test-native (push) Failing after 5m35s
CI with Native Libraries / build-release (push) Has been skipped
Test / test (push) Successful in 1s

This commit is contained in:
Jeremie Fraeys 2026-02-12 13:21:37 -05:00
parent d3f1a1841a
commit 06690230e2
No known key found for this signature in database

View file

@ -0,0 +1,76 @@
name: CI with Native Libraries
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test-native:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Setup CMake
run: |
# Install cmake if not present (adjust for your self-hosted OS)
which cmake || (apt-get update && apt-get install -y cmake zlib1g-dev 2>/dev/null || brew install cmake zlib)
- name: Build Native Libraries
run: make native-build
- name: Test with Native Libraries
run: FETCHML_NATIVE_LIBS=1 go test -v ./tests/...
env:
FETCHML_NATIVE_LIBS: "1"
- name: Test Fallback (Go only)
run: FETCHML_NATIVE_LIBS=0 go test -v ./tests/...
env:
FETCHML_NATIVE_LIBS: "0"
- name: Run Benchmarks
run: |
echo "=== Go Implementation ==="
FETCHML_NATIVE_LIBS=0 go test -bench=. ./tests/benchmarks/ -benchmem
echo ""
echo "=== Native Implementation ==="
FETCHML_NATIVE_LIBS=1 go test -bench=. ./tests/benchmarks/ -benchmem
- name: Lint
run: |
make lint || true
build-release:
runs-on: self-hosted
needs: test-native
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Setup Build Tools
run: |
which cmake || (apt-get update && apt-get install -y cmake zlib1g-dev 2>/dev/null || brew install cmake zlib)
- name: Build Release Libraries
run: make native-release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: native-libs-${{ runner.os }}-${{ runner.arch }}
path: |
native/build/lib*.so
native/build/lib*.dylib