-
Notifications
You must be signed in to change notification settings - Fork 39
143 lines (126 loc) · 4.71 KB
/
build-cpp-runtime-bindings.yml
File metadata and controls
143 lines (126 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Copyright 2025 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build and test C++ Runtime Bindings
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
build-cpp-runtime-bindings:
name: Build and unit tests for C++ runtime bindings
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: "with static library"
enable_lvq_leanvec: "ON"
enable_ivf: "OFF"
suffix: ""
- name: "public only"
enable_lvq_leanvec: "OFF"
enable_ivf: "OFF"
suffix: "-public-only"
- name: "IVF public only"
enable_lvq_leanvec: "OFF"
enable_ivf: "ON"
suffix: "-ivf"
fail-fast: false
steps:
- uses: actions/checkout@v6
- name: Build Docker image
run: |
docker build -t svs-manylinux228:latest -f docker/x86_64/manylinux228/Dockerfile .
- name: Build libraries in Docker container
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
-e ENABLE_LVQ_LEANVEC=${{ matrix.enable_lvq_leanvec }} \
-e ENABLE_IVF=${{ matrix.enable_ivf }} \
-e SUFFIX=${{ matrix.suffix }} \
svs-manylinux228:latest \
/bin/bash .github/scripts/build-cpp-runtime-bindings.sh
- name: Upload cpp runtime bindings artifacts
uses: actions/upload-artifact@v7
with:
name: svs-cpp-runtime-bindings${{ matrix.suffix }}
path: svs-cpp-runtime-bindings${{ matrix.suffix }}.tar.gz
retention-days: 7 # Reduce retention due to size
- name: Upload conda package artifacts
uses: actions/upload-artifact@v7
with:
name: libsvs-runtime-conda${{ matrix.suffix }}
path: conda-bld/linux-64/libsvs-runtime-*.conda
retention-days: 7
# Run unit tests that were built as part of this job
- name: Run unit tests in Docker container
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
-e ENABLE_IVF=${{ matrix.enable_ivf }} \
svs-manylinux228:latest \
/bin/bash -c "source /etc/bashrc || true && \
if [ \"\${ENABLE_IVF}\" = 'ON' ] && [ -f /opt/intel/oneapi/setvars.sh ]; then source /opt/intel/oneapi/setvars.sh 2>/dev/null || true; fi && \
ctest --test-dir bindings/cpp/build_cpp_bindings/tests --output-on-failure --no-tests=error --verbose"
# Run full test script using the built artifacts
test:
name: Integration tests for C++ runtime
needs: build-cpp-runtime-bindings
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: "with static library"
suffix: ""
enable_ivf: "OFF"
- name: "public only"
suffix: "-public-only"
enable_ivf: "OFF"
- name: "IVF public only"
suffix: "-ivf"
enable_ivf: "ON"
fail-fast: false
steps:
- uses: actions/checkout@v6
- name: Build Docker image
run: |
docker build -t svs-manylinux228:latest -f docker/x86_64/manylinux228/Dockerfile .
# Need to download for a new job
- name: Download conda package
uses: actions/download-artifact@v8
with:
name: libsvs-runtime-conda${{ matrix.suffix }}
path: runtime_conda
- name: List available artifacts
run: |
ls -la runtime_conda/
- name: Test in Docker container
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-v ${{ github.workspace }}/runtime_conda:/runtime_conda \
-w /workspace \
-e SUFFIX=${{ matrix.suffix }} \
-e ENABLE_IVF=${{ matrix.enable_ivf }} \
svs-manylinux228:latest \
/bin/bash .github/scripts/test-cpp-runtime-bindings.sh