-
Notifications
You must be signed in to change notification settings - Fork 0
200 lines (189 loc) · 9.3 KB
/
ci_build_test.yml
File metadata and controls
200 lines (189 loc) · 9.3 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Technology Template Build Test
on:
pull_request:
branches: [main]
#schedule:
# Every Monday at 0:00 UTC
#- cron: "0 0 * * 1"
jobs:
cmake_build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { name: "CMake Windows Latest MSVC", os: windows-latest }
- { name: "CMake Ubuntu Latest GCC", os: ubuntu-latest }
- { name: "CMake macOS Latest Clang", os: macos-latest }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.24.x'
# CHECKOUT templates and generate APIs
- name: create dir and checkout qt template
run: mkdir template-qtcpp
- uses: actions/checkout@v4
with:
repository: apigear-io/template-qtcpp
path: template-qtcpp
- name: create dir cpp template
run: mkdir template-cpp14
- uses: actions/checkout@v4
with:
repository: apigear-io/template-cpp14
path: template-cpp14
- name: create dir python template
run: mkdir template-python
- uses: actions/checkout@v4
with:
repository: apigear-io/template-python
path: template-python
- name: create dir unreal template
run: mkdir template-unreal
- uses: actions/checkout@v4
with:
repository: apigear-io/template-unreal
path: template-unreal
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: 1.23
- name: Generate APIs
run: go run main.go install
- run: go run main.go generateAPI
#QT BUILD
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.5.2'
cache: 'true'
modules: qtwebsockets
- name: create mqtt dir
run: |
mkdir qtmqtt
- name: Checkout QMqtt
uses: actions/checkout@v4
with:
repository: qt/qtmqtt
ref: '6.5.2'
path: qtmqtt
- name: Build qmqtt windows
if: ${{ matrix.config.os == 'windows-latest'}}
working-directory: qtmqtt
run: |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS_DEBUG="-O2" .
cmake --build . --config RelWithDebInfo
cmake --install . --verbose
- name: Build qmqtt mac and linux
if: ${{ matrix.config.os != 'windows-latest'}}
working-directory: qtmqtt
run: |
cmake .
cmake --build .
cmake --install . --verbose
- name: Qt build (Windows update path env)
if: ${{ matrix.config.os == 'windows-latest'}}
run: echo "$GITHUB_WORKSPACE/qt/build/bin/Debug/" >> $GITHUB_PATH
- name: qt api and tests build
working-directory: qt
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: cmake -Bbuild -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=tmp && cmake --build build/ && cmake --build build/
#BUILD CPP
- name: Cache conan on Windows
uses: actions/cache@v4
if: ${{ matrix.config.os == 'windows-latest'}}
with:
path: |
~\.conan2\p
key: ${{ matrix.config.os }}-conan4cmake-release-cache-${{ hashFiles('.github/workflows/ci_build_test.yml') }}
restore-keys: |
${{ matrix.config.os }}-conan4cmake-release-cache
- name: Cache conan on Linux/macOS
uses: actions/cache@v4
if: ${{ matrix.config.os != 'windows-latest'}}
with:
path: |
~/.conan2/p
key: ${{ matrix.config.os }}-conan4cmake-release-cache-${{ hashFiles('.github/workflows/ci_build_test.yml') }}
restore-keys: |
${{ matrix.config.os }}-conan4cmake-release-cache
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: "pip"
cache-dependency-path: ".github/workflows/conan-requirements.txt"
- name: Install Conan
run: pip3 install -r .github/workflows/conan-requirements.txt
- name: Create release profile
run: conan profile detect --name release
- run: cmake --version
- run: mkdir -p deps
- name: Install poco using conan
run: |
cd deps && conan install --profile=release --profile:build=release --requires=poco/1.12.4 --build missing -o poco/*:shared=False -o poco/*:enable_data_mysql=False -o poco/*:enable_activerecord=False -o poco/*:enable_apacheconnector=False -o poco/*:enable_cppparser=False -o poco/*:enable_crypto=True -o poco/*:enable_data=False -o poco/*:enable_data_odbc=False -o poco/*:enable_data_postgresql=False -o poco/*:enable_data_sqlite=False -o poco/*:enable_encodings=False -o poco/*:enable_json=False -o poco/*:enable_jwt=False -o poco/*:enable_mongodb=False -o poco/*:enable_net=True -o poco/*:enable_netssl=True -o poco/*:enable_pagecompiler=False -o poco/*:enable_pagecompiler_file2page=False -o poco/*:enable_pdf=False -o poco/*:enable_pocodoc=False -o poco/*:enable_redis=False -o poco/*:enable_sevenzip=False -o poco/*:enable_util=True -o poco/*:enable_xml=False -o poco/*:enable_zip=False --generator CMakeDeps --generator VirtualBuildEnv
- name: Install paho.mqtt.c using conan
run: |
cd deps && conan install --profile=release --profile:build=release --requires=paho-mqtt-c/1.3.13 --build missing -o paho-mqtt-c/*:shared=False --generator CMakeDeps --generator VirtualBuildEnv
- name: Install eigen using conan for extern type testing
run: |
cd deps && conan install --profile=release --profile:build=release --requires=eigen/3.4.0 --build missing --generator CMakeDeps --generator VirtualBuildEnv
- name: Save cache conan on Windows
uses: actions/cache/save@v4
if: ${{ matrix.config.os == 'windows-latest'}}
with:
path: |
~\.conan2\p
key: ${{ matrix.config.os }}-conan4cmake-cache-${{ hashFiles('.github/workflows/ci_build_test.yml') }}
- name: Save cache conan on Linux/macOS
uses: actions/cache/save@v4
if: ${{ matrix.config.os != 'windows-latest'}}
with:
path: |
~/.conan2/p
key: ${{ matrix.config.os }}-conan4cmake-cache-${{ hashFiles('.github/workflows/ci_build_test.yml') }}
- name: cpp api and tests build for Linux/Mac
if: ${{ matrix.config.os != 'windows-latest'}}
working-directory: cpp
run: cmake -Bbuild -DCMAKE_INSTALL_PREFIX=tmp -DCMAKE_PREFIX_PATH:PATH=$GITHUB_WORKSPACE/deps -DCMAKE_MODULE_PATH=$GITHUB_WORKSPACE/deps -DCMAKE_BUILD_TYPE=Release -DAPIGEAR_FETCH_OLINKCORE=ON -DCPP_FETCH_DEPS=ON && cmake --build build/ --config Release && cmake --build build/ --target install --config Release
- name: Update path env on Windows for testing
if: ${{ matrix.config.os == 'windows-latest'}}
run: echo "$GITHUB_WORKSPACE/cpp/build/bin/Release/" >> $GITHUB_PATH
- name: cpp api and tests build for windows
if: ${{ matrix.config.os == 'windows-latest'}}
working-directory: cpp
run: |
$Env:GITHUB_WORKSPACE_UNIX = "${{ github.workspace }}" -replace "\\","/"
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=tmp -DCMAKE_PREFIX_PATH:PATH="$Env:GITHUB_WORKSPACE_UNIX/deps" -DCMAKE_MODULE_PATH="$Env:GITHUB_WORKSPACE_UNIX/deps" -DCMAKE_BUILD_TYPE=Release -DAPIGEAR_FETCH_OLINKCORE=ON -DCPP_FETCH_DEPS=ON && cmake --build build/ --config Release && cmake --build build/ --target install --config Release
- name: Archive cpp release artifacts
uses: actions/upload-artifact@v4
with:
name: cpp-install-artifacts-${{ matrix.config.os }}
path: |
cpp/tmp
retention-days: 5
# Run tests
- name: RUN olink core no network syncIntMethodCall test WINDOWS
if: ${{ matrix.config.os == 'windows-latest'}}
run: ./cpp/build/bin/Release/olink_core_no_network_single_object_syncIntMethodCall.exe
- name: RUN olink core no network syncIntMethodCall test linux/mac
if: ${{ matrix.config.os != 'windows-latest'}}
run: ./cpp/build/bin/olink_core_no_network_single_object_syncIntMethodCall
- name: RUN olink core no network setIntProperty test WINDOWS
if: ${{ matrix.config.os == 'windows-latest'}}
run: ./cpp/build/bin/Release/olink_core_no_network_single_object_setIntProperty.exe
- name: RUN olink core no network setIntProperty test linux/mac
if: ${{ matrix.config.os != 'windows-latest'}}
run: ./cpp/build/bin/olink_core_no_network_single_object_setIntProperty
- name: RUN scenario olink, single object, set INT and STRING Property on WINDOWS
if: ${{ matrix.config.os == 'windows-latest'}}
run: py testRunner/testRunner/testRunner.py "testRunner/testRunner/scenarios/olink_single_object_setProperty.txt" "./cpp/build/bin/Release" "./qt/build/bin/Debug" -RunAsAdmin
- name: RUN scenario olink, single object, set INT and STRING Property on linux/mac
if: ${{ matrix.config.os != 'windows-latest'}}
run: sudo python testRunner/testRunner/testRunner.py "testRunner/testRunner/scenarios/olink_single_object_setProperty.txt" "cpp/build/bin" "qt/build/bin"