From 3c53944ec7dac529cfd351ad5580d558ec29c1cc Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 30 Jul 2024 14:01:36 +0200 Subject: [PATCH] .github/workflows/ci.yml: test-build the Go bridge. --- .github/workflows/ci.yml | 10 ++++++++++ poc/go/poc_test.go | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44c370e..0c96d0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,7 @@ jobs: ~/.cargo/registry **/Cargo.lock **/target + go/pkg key: ${{ runner.os }}-cargo-${{ steps.get-date.outputs.date }} - name: Environment @@ -97,6 +98,15 @@ jobs: cargo clean -p msm-cuda --release ) + - name: Test-build Go bridge with cuda-12.3 + shell: bash + run: | + go version + export PATH=$PATH:/usr/local/cuda-12.3/bin + ( cd poc/go + env CGO_CFLAGS="-O2 -D__SPPARK_CGO_DEBUG__" go test + ) + - name: Install cuda-minimal-build-11-8 shell: bash run: | diff --git a/poc/go/poc_test.go b/poc/go/poc_test.go index ddd1048..ad08227 100644 --- a/poc/go/poc_test.go +++ b/poc/go/poc_test.go @@ -6,7 +6,9 @@ import ( ) func TestInit(t *testing.T) { - CudaFunc() + if sppark.IsCudaAvailable() { + CudaFunc() + } if err := sppark.Exfiltrate("."); err != nil { t.Error(err) }