Skip to content

Commit 4d1fa95

Browse files
Merge pull request #1 from TeiaCare/github-action
Added GitHub action
2 parents 3bb7e3d + 45d5f49 commit 4d1fa95

File tree

17 files changed

+291
-23184
lines changed

17 files changed

+291
-23184
lines changed

.github/actions/shell/action.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Run Shell Commands"
2+
description: "Runs a list of commands on the native OS shell"
3+
4+
inputs:
5+
commands:
6+
description: 'Multiline string of commands to run'
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: CMD
13+
if: runner.os == 'Windows'
14+
shell: cmd
15+
run: |
16+
${{ inputs.commands }}
17+
18+
- name: Bash
19+
if: runner.os != 'Windows'
20+
shell: bash
21+
run: |
22+
${{ inputs.commands }}

.github/workflows/build.yml

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,246 @@
1+
name: Build
12

3+
on:
4+
push:
5+
workflow_dispatch:
6+
inputs:
7+
force_deployment:
8+
description: 'Force Conan package deploy'
9+
required: true
10+
default: true
11+
type: boolean
12+
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
build_type: ['Debug', 'Release', 'RelWithDebInfo']
20+
config:
21+
# - name: windows2022_msvc2022
22+
# os: windows-2022
23+
# compiler: visual_studio
24+
# compiler_version: 17
25+
# setup_build_env: 'call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
26+
# activate_venv: 'call ".venv\\Scripts\\activate.bat"'
27+
28+
# - name: windows2019_msvc2019
29+
# os: windows-2019
30+
# compiler: visual_studio
31+
# compiler_version: 16
32+
# setup_build_env: 'call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
33+
# activate_venv: 'call ".venv\\Scripts\\activate.bat"'
34+
35+
- name: macos14_clang15
36+
os: macos-14
37+
compiler: clang
38+
compiler_version: 15
39+
setup_build_env: ""
40+
activate_venv: 'source .venv/bin/activate'
41+
42+
- name: ubuntu2204_gcc12
43+
os: ubuntu-22.04
44+
compiler: gcc
45+
compiler_version: 12
46+
setup_build_env: ""
47+
activate_venv: 'source .venv/bin/activate'
48+
49+
- name: ubuntu2204_clang15
50+
os: ubuntu-22.04
51+
compiler: clang
52+
compiler_version: 15
53+
setup_build_env: ""
54+
activate_venv: 'source .venv/bin/activate'
55+
56+
runs-on: ${{ matrix.config.os }}
57+
name: CI ${{ matrix.config.name }} ${{ matrix.build_type }}
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v4
62+
with:
63+
submodules: true
64+
65+
- name: Set Python version
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: '3.12'
69+
architecture: 'x64'
70+
71+
- name: Setup Virtual Environment
72+
uses: ./.github/actions/shell
73+
with:
74+
commands: |
75+
python3 -m venv .venv
76+
${{ matrix.config.activate_venv }}
77+
pip3 install -r scripts/requirements.txt
78+
conan remote add teiacare ${{ secrets.ARTIFACTORY_URL }}/teiacare --insert 0 --force
79+
conan user ${{ secrets.ARTIFACTORY_USERNAME }} -p ${{ secrets.ARTIFACTORY_PASSWORD }} -r teiacare
80+
env:
81+
CONAN_USER_HOME: ${{ github.workspace }}
82+
83+
- name: Setup Conan
84+
uses: ./.github/actions/shell
85+
with:
86+
commands: |
87+
${{ matrix.config.activate_venv }}
88+
python3 scripts/conan/setup.py ${{ matrix.build_type }} ${{ matrix.config.compiler }} ${{ matrix.config.compiler_version }}
89+
env:
90+
CONAN_USER_HOME: ${{ github.workspace }}
91+
92+
- name: Build
93+
uses: ./.github/actions/shell
94+
with:
95+
commands: |
96+
${{ matrix.config.activate_venv }}
97+
${{ matrix.config.setup_build_env }}
98+
python3 scripts/cmake.py ${{ matrix.build_type }} ${{ matrix.config.compiler }} ${{ matrix.config.compiler_version }} --warnings
99+
env:
100+
CONAN_USER_HOME: ${{ github.workspace }}
101+
102+
- name: Unit Tests
103+
uses: ./.github/actions/shell
104+
with:
105+
commands: |
106+
${{ matrix.config.activate_venv }}
107+
${{ matrix.config.setup_build_env }}
108+
python3 scripts/cmake.py ${{ matrix.build_type }} ${{ matrix.config.compiler }} ${{ matrix.config.compiler_version }} --warnings --coverage
109+
python3 scripts/tools/run_unit_tests.py ${{ matrix.build_type }}
110+
env:
111+
CONAN_USER_HOME: ${{ github.workspace }}
112+
continue-on-error: true
113+
timeout-minutes: 5
114+
115+
# - name: Run Code Coverage ([email protected])
116+
# uses: ./.github/actions/shell
117+
# if: ${{ matrix.build_type == 'Release' && matrix.config.name == 'ubuntu2204_gcc12' }}
118+
# with:
119+
# commands: |
120+
# ${{ matrix.config.activate_venv }}
121+
# python3 scripts/tools/run_coverage.py ${{ matrix.config.compiler }} ${{ matrix.config.compiler_version }}
122+
# env:
123+
# CONAN_USER_HOME: ${{ github.workspace }}
124+
# continue-on-error: true
125+
# timeout-minutes: 5
126+
127+
# - name: Upload Codecov
128+
# if: ${{ matrix.build_type == 'Release' && matrix.config.name == 'ubuntu2204_gcc12' }}
129+
# uses: codecov/codecov-action@v4
130+
# with:
131+
# files: './results/coverage/cobertura.xml'
132+
# name: TeiaCareVideoIO
133+
# slug: TeiaCare/TeiaCareVideoIO
134+
# token: ${{secrets.CODECOV_TOKEN}}
135+
# flags: '${{ matrix.build_type }} ${{ matrix.config.compiler }} ${{ matrix.config.compiler_version }}'
136+
137+
# - name: Upload Codacy
138+
# if: ${{ matrix.build_type == 'Release' && matrix.config.name == 'ubuntu2204_gcc12' }}
139+
# run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r results/coverage/cobertura.xml
140+
# env:
141+
# CODACY_PROJECT_TOKEN: ${{secrets.CODACY_TOKEN}}
142+
143+
- name: Create Conan Package
144+
uses: ./.github/actions/shell
145+
with:
146+
commands: |
147+
${{ matrix.config.activate_venv }}
148+
${{ matrix.config.setup_build_env }}
149+
python3 scripts/conan/create.py ${{ matrix.build_type }} ${{ matrix.config.compiler }} ${{ matrix.config.compiler_version }}
150+
env:
151+
CONAN_USER_HOME: ${{ github.workspace }}
152+
153+
- name: Publish Conan cache
154+
uses: actions/upload-artifact@v4
155+
with:
156+
name: ${{ matrix.config.name }}-${{ matrix.build_type }}
157+
path: .conan
158+
if-no-files-found: error
159+
overwrite: true
160+
include-hidden-files: true
161+
162+
deploy:
163+
needs: build
164+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.force_deployment == 'true' || github.ref == 'refs/heads/develop' }}
165+
strategy:
166+
fail-fast: false
167+
matrix:
168+
build_type: ['Debug', 'Release', 'RelWithDebInfo']
169+
config:
170+
# - name: windows2022_msvc2022
171+
# os: windows-2022
172+
# compiler: visual_studio
173+
# compiler_version: 17
174+
# setup_build_env: 'call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
175+
# activate_venv: 'call ".venv\\Scripts\\activate.bat"'
176+
177+
# - name: windows2019_msvc2019
178+
# os: windows-2019
179+
# compiler: visual_studio
180+
# compiler_version: 16
181+
# setup_build_env: 'call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"'
182+
# activate_venv: 'call ".venv\\Scripts\\activate.bat"'
183+
184+
# - name: macos14_clang15
185+
# os: macos-14
186+
# compiler: clang
187+
# compiler_version: 15
188+
# setup_build_env: ""
189+
# activate_venv: 'source .venv/bin/activate'
190+
191+
- name: ubuntu2204_gcc12
192+
os: ubuntu-22.04
193+
compiler: gcc
194+
compiler_version: 12
195+
setup_build_env: ""
196+
activate_venv: 'source .venv/bin/activate'
197+
198+
- name: ubuntu2204_clang15
199+
os: ubuntu-22.04
200+
compiler: clang
201+
compiler_version: 15
202+
setup_build_env: ""
203+
activate_venv: 'source .venv/bin/activate'
204+
205+
runs-on: ${{ matrix.config.os }}
206+
name: CD ${{ matrix.config.name }} ${{ matrix.build_type }}
207+
208+
steps:
209+
- name: Checkout repository
210+
uses: actions/checkout@v4
211+
with:
212+
submodules: true
213+
214+
- name: Set Python version
215+
uses: actions/setup-python@v5
216+
with:
217+
python-version: '3.12'
218+
architecture: 'x64'
219+
220+
- name: Setup Virtual Environment
221+
uses: ./.github/actions/shell
222+
with:
223+
commands: |
224+
python3 -m venv .venv
225+
${{ matrix.config.activate_venv }}
226+
pip3 install -r scripts/requirements.txt
227+
conan remote add teiacare ${{ secrets.ARTIFACTORY_URL }}/teiacare --insert 0 --force
228+
conan user ${{ secrets.ARTIFACTORY_USERNAME }} -p ${{ secrets.ARTIFACTORY_PASSWORD }} -r teiacare
229+
env:
230+
CONAN_USER_HOME: ${{ github.workspace }}
231+
232+
- name: Download Conan cache artifacts
233+
uses: actions/download-artifact@v4
234+
with:
235+
name: ${{ matrix.config.name }}-${{ matrix.build_type }}
236+
path: .conan/
237+
238+
- name: Upload Conan Package
239+
uses: ./.github/actions/shell
240+
with:
241+
commands: |
242+
${{ matrix.config.activate_venv }}
243+
${{ matrix.config.setup_build_env }}
244+
python3 scripts/conan/upload.py teiacare ${{ secrets.ARTIFACTORY_URL }} ${{ secrets.ARTIFACTORY_USERNAME }} ${{ secrets.ARTIFACTORY_PASSWORD }}
245+
env:
246+
CONAN_USER_HOME: ${{ github.workspace }}

.github/workflows/docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,19 @@ jobs:
2828
url: ${{ steps.deployment.outputs.page_url }}
2929

3030
steps:
31-
- name: Checkout
31+
- name: Checkout repository
3232
uses: actions/checkout@v4
33+
with:
34+
submodules: true
3335

3436
- name: Setup GitHub Pages
3537
uses: actions/configure-pages@v4
3638

37-
- name: Build Docs
39+
- name: Install Doxygen
3840
run: sudo apt-get install -y doxygen graphviz
3941

4042
- name: Build Docs
41-
run: python3 scripts/tools/run_doxygen.py
43+
run: python3 scripts/tools/run_doxygen.py -d inference_client/docs/Doxyfile
4244

4345
- name: Upload Docs
4446
uses: actions/upload-pages-artifact@v3

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Examples:
5252
### Dependencies Setup
5353
This script must be executed in order to setup the 3rd party dependencies using conan packages.
5454
```bash
55+
conan remote add teiacare https://artifactory.app.teiacare.com/artifactory/api/conan/teiacare --insert 0 --force
56+
conan user <USERNAME> -p <PASSWORD> -r teiacare
57+
5558
python scripts/conan/setup.py <Debug|Release|RelWithDebInfo> <COMPILER_NAME> <COMPILER_VERSION>
5659
```
5760

cmake/warnings.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function(add_warnings_as_errors TARGET)
1212
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
1313
target_compile_options(${TARGET} PRIVATE -Werror)
1414
elseif(MSVC)
15+
# On Visual Studio disable warnings from 3rd party dependencies.
16+
target_compile_options(${TARGET} PRIVATE /wd4100 /wd4127 /wd4267 /wd4244 /wd4018 /wd4702)
1517
target_compile_options(${TARGET} PRIVATE /WX)
1618
endif()
1719
endfunction()

conanfile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def configure(self):
5858
self.options["grpc"].php_plugin=False
5959
self.options["grpc"].python_plugin=False
6060
self.options["grpc"].ruby_plugin=False
61-
self.options["grpc"].otel_plugin=False
6261
self.options["grpc"].secure=True
6362

6463
def generate(self):

inference_client/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ if(TC_ENABLE_WARNINGS_ERROR)
5959
add_warnings_as_errors(${TARGET_NAME})
6060
endif()
6161

62+
if(TC_ENABLE_SANITIZER_ADDRESS)
63+
include(sanitizer_address)
64+
add_sanitizer_address(${TARGET_NAME})
65+
endif()
66+
67+
if(TC_ENABLE_SANITIZER_THREAD)
68+
include(sanitizer_thread)
69+
add_sanitizer_thread(${TARGET_NAME})
70+
endif()
71+
6272
#################################################################
6373
# Unit Tests
6474
if(TC_ENABLE_UNIT_TESTS)

inference_client/conanfile.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ grpc/1.67.1
33
spdlog/1.14.1
44
gtest/1.15.0
55

6-
#opencv/4.5.5
7-
#triton-client/2.31.0@teiacare/stable
8-
96
[generators]
107
CMakeDeps
118

@@ -19,7 +16,4 @@ grpc:objective_c_plugin=False
1916
grpc:php_plugin=False
2017
grpc:python_plugin=False
2118
grpc:ruby_plugin=False
22-
gpc:otel_plugin=False
2319
grpc:secure=True
24-
25-
opencv:with_ffmpeg=False

0 commit comments

Comments
 (0)