Skip to content

Commit 508e0e2

Browse files
committed
Install python3-dev and pkg-config
Signed-off-by: Pierangelo Di Pilato <[email protected]>
1 parent 97e7e80 commit 508e0e2

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/ci-pr-checks.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ jobs:
2121
go-version-file: ./go.mod
2222
cache-dependency-path: ./go.sum
2323

24-
- name: Install libzmq dependencies (kvcache/kvevents)
24+
- name: Install libzmq and Python dependencies (kvcache/kvevents)
2525
run: |
2626
sudo apt-get update
27+
sudo apt-get install -y pkg-config python3-dev
2728
make download-zmq
2829
30+
- name: Configure CGO for Python
31+
run: |
32+
PYTHON_INCLUDE=$(python3 -c "import sysconfig; print(sysconfig.get_path('include'))")
33+
echo "CPATH=${PYTHON_INCLUDE}:${CPATH}" >> $GITHUB_ENV
34+
echo "CGO_ENABLED=1" >> $GITHUB_ENV
35+
echo "CGO_CFLAGS=$(python3-config --cflags --embed)" >> $GITHUB_ENV
36+
echo "CGO_LDFLAGS=$(python3-config --ldflags --embed)" >> $GITHUB_ENV
37+
2938
- name: Set PKG_CONFIG_PATH
3039
run: echo "PKG_CONFIG_PATH=/usr/lib/pkgconfig" >> $GITHUB_ENV
3140

@@ -34,9 +43,21 @@ jobs:
3443
with:
3544
version: 'v2.4.0'
3645
args: "--config=./.golangci.yml"
46+
env:
47+
CGO_ENABLED: ${{ env.CGO_ENABLED }}
48+
CGO_CFLAGS: ${{ env.CGO_CFLAGS }}
49+
CGO_LDFLAGS: ${{ env.CGO_LDFLAGS }}
50+
CPATH: ${{ env.CPATH }}
51+
PKG_CONFIG_PATH: ${{ env.PKG_CONFIG_PATH }}
3752

3853
- name: Run go test
3954
shell: bash
4055
run: |
4156
echo "Running tests with Ginkgo..."
4257
make test
58+
env:
59+
CGO_ENABLED: ${{ env.CGO_ENABLED }}
60+
CGO_CFLAGS: ${{ env.CGO_CFLAGS }}
61+
CGO_LDFLAGS: ${{ env.CGO_LDFLAGS }}
62+
CPATH: ${{ env.CPATH }}
63+
PKG_CONFIG_PATH: ${{ env.PKG_CONFIG_PATH }}

0 commit comments

Comments
 (0)