-
Notifications
You must be signed in to change notification settings - Fork 59
229 lines (204 loc) · 8.4 KB
/
build-test-ubuntu-x64.yml
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: Build and test Ubuntu x64
on:
workflow_call:
inputs:
docker_image_tag:
required: true
type: string
app_version:
required: true
type: string
full_config_build:
default: false
required: false
type: boolean
autotest_data_s3_url:
default: "s3://data-autotest/test_data_2024-nov-07"
required: false
type: string
UPLOAD_ARTIFACTS:
required: true
type: boolean
mrbind:
default: true
required: false
type: boolean
jobs:
ubuntu-x64-build-test:
timeout-minutes: 40
runs-on: [self-hosted, x64, docker-ready, build]
container:
image: meshlib/meshlib-${{matrix.os}}:${{inputs.docker_image_tag}}
options: --user root
strategy:
fail-fast: false
matrix:
os: [ ubuntu20, ubuntu22, ubuntu24 ]
config: [ Debug, Release ]
compiler: [ Clang, GCC ]
full_config_build:
- ${{fromJSON(inputs.full_config_build)}}
exclude:
# Do not run Debug Clang build on every commit (but only once a day)
- full_config_build: false
config: Debug
compiler: Clang
# Do not run Release GCC build on every commit (but only once a day)
- full_config_build: false
config: Release
compiler: GCC
- os: ubuntu24
compiler: GCC
- os: ubuntu24
config: Debug
include:
- os: ubuntu20
compiler: Clang
cxx-compiler: /usr/bin/clang++-11
c-compiler: /usr/bin/clang-11
use-cpp-23: "OFF"
build_mrcuda: "ON"
- os: ubuntu20
compiler: GCC
cxx-compiler: /usr/bin/g++-10
c-compiler: /usr/bin/gcc-10
use-cpp-23: "OFF"
build_mrcuda: "ON"
- os: ubuntu22
compiler: Clang
cxx-compiler: /usr/bin/clang++-14
c-compiler: /usr/bin/clang-14
use-cpp-23: "OFF"
build_mrcuda: "ON"
- os: ubuntu22
compiler: GCC
cxx-compiler: /usr/bin/g++-12
c-compiler: /usr/bin/gcc-12
use-cpp-23: "ON"
build_mrcuda: "ON"
- os: ubuntu24
compiler: Clang
cxx-compiler: /usr/bin/clang++-18
c-compiler: /usr/bin/clang-18
use-cpp-23: "ON"
build_mrcuda: "ON"
# - os: ubuntu24
# compiler: GCC
# cxx-compiler: /usr/bin/g++-13
# c-compiler: /usr/bin/gcc-13
# use-cpp-23: "ON"
# build_mrcuda: "OFF"
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
env:
UPLOAD_TEST_ARTIFACTS: ${{ contains(github.event.pull_request.labels.*.name, 'upload-test-artifacts') }}
INTERNAL_BUILD: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout third-party submodules
run: |
# have to checkout selective submodules by our own
# related issue: https://github.com/actions/checkout/issues/1779
export HOME=${RUNNER_TEMP}
git config --global --add safe.directory ${GITHUB_WORKSPACE}
git submodule update --init --depth 1 thirdparty/imgui thirdparty/parallel-hashmap
- name: Install thirdparty libs
run: |
ln -s /usr/local/lib/meshlib-thirdparty-lib/lib ./lib
ln -s /usr/local/lib/meshlib-thirdparty-lib/include ./include
- name: Install mrbind
if: ${{inputs.mrbind}}
run: scripts/mrbind/install_mrbind_ubuntu.sh
- name: Create virtualenv
run: |
python3 -m venv .venv
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Setup python requirements
run: python3 -m pip install -r ./requirements/python.txt
- name: Check that MRBind bindings parse successfully
if: ${{inputs.mrbind}}
env:
CXX: ${{matrix.cxx-compiler}}
run: |
make -f scripts/mrbind/generate.mk only-generate
- name: Build
run: ./scripts/build_source.sh
env:
MESHLIB_BUILD_RELEASE: ${{ fromJSON('["OFF", "ON"]')[matrix.config == 'Release'] }}
MESHLIB_BUILD_DEBUG: ${{ fromJSON('["OFF", "ON"]')[matrix.config == 'Debug'] }}
CMAKE_CXX_COMPILER: ${{ matrix.cxx-compiler }}
MR_VERSION: ${{ inputs.app_version }}
# options to be passed to cmake
MR_CMAKE_OPTIONS: >
-DMR_USE_CPP_23=${{ matrix.use-cpp-23 }}
-DMESHLIB_BUILD_MRCUDA=${{ matrix.build_mrcuda }}
-DMR_PCH_USE_EXTRA_HEADERS=ON
-DMESHLIB_BUILD_MRMESH_PY_LEGACY=${{ fromJSON('["ON", "OFF"]')[inputs.mrbind] }}
# not realy needed
CMAKE_C_COMPILER: ${{ matrix.c-compiler }}
- name: Generate and build MRBind bindings
if: ${{inputs.mrbind}}
env:
CXX: ${{matrix.cxx-compiler}}
run: make -f scripts/mrbind/generate.mk MODE=none -B --trace MESHLIB_SHLIB_DIR=build/${{matrix.config}}/bin
- name: Collect Timings
run: ./scripts/devops/collect_timing_logs.sh ${{matrix.os}} ${{matrix.config}} "${{matrix.compiler}}"
#Save timing in artifact
- name: Upload Timings
uses: actions/upload-artifact@v4
with:
name: Timing_Logs_${{matrix.os}}-x86_${{matrix.config}}_${{matrix.compiler}}
path: time_log/
- name: Run Start-and-Exit Tests
run: MR_LOCAL_RESOURCES=1 xvfb-run -a ./build/${{ matrix.config }}/bin/MeshViewer -hidden -noEventLoop -unloadPluginsAtEnd
- name: Unit Tests
run: ./build/${{ matrix.config }}/bin/MRTest
- name: C Unit Tests
run: ./build/${{ matrix.config }}/bin/MRTestC
- name: Python Sanity Tests
working-directory: ./build/${{ matrix.config }}/bin
run: python3 ./../../../scripts/run_python_test_script.py -d '../test_python'
- name: Configure AWS Credentials
if: ${{ env.UPLOAD_TEST_ARTIFACTS == 'true' || env.INTERNAL_BUILD == 'true' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::259351611210:role/GitHubMeshLibAwsCredsRole
aws-region: us-east-1
# cache managment: https://github.com/MeshInspector/MeshLib/actions/caches
- name: Cache autotest data from S3 Tests
if: ${{ env.UPLOAD_TEST_ARTIFACTS == 'true' || env.INTERNAL_BUILD == 'true' }}
id: cache-autotest
uses: actions/cache@v4
with:
path: ./test_data
key: ${{inputs.autotest_data_s3_url}}
- name: Copy autotest data from S3 Tests
if: ${{ env.UPLOAD_TEST_ARTIFACTS == 'true' || env.INTERNAL_BUILD == 'true' }}
run: aws s3 sync ${{inputs.autotest_data_s3_url}} ./test_data --delete --no-sign-request --size-only
- name: Python Regression Tests
env:
SMOKE: ${{ env.INTERNAL_BUILD == 'true' && inputs.full_config_build == false && matrix.config == 'Debug' }}
BINDS_V: ${{ fromJSON('[2,3]')[inputs.mrbind || 0] }}
working-directory: ./build/${{ matrix.config }}/bin
run: python3 ./../../../scripts/run_python_test_script.py -d '../test_regression' -s ${{env.SMOKE}} -bv ${{env.BINDS_V}}
- name: Copy test artifacts to S3
if: ${{ env.UPLOAD_TEST_ARTIFACTS == 'true' && env.INTERNAL_BUILD == 'true' && !cancelled() }}
run: aws s3 cp ./pytest_temp 's3://test-artifacts-git/tests/${{github.run_id}}/${{matrix.os}}/${{matrix.config}}/${{matrix.compiler}}' --recursive
- name: Create Deb
if: ${{ inputs.UPLOAD_ARTIFACTS && matrix.compiler == 'Clang' && matrix.config == 'Release'}}
env:
MESHLIB_BUILD_RELEASE: "ON"
MESHLIB_BUILD_DEBUG: "OFF"
run: |
./scripts/distribution.sh ${{inputs.app_version}}
mv ./distr/meshlib-dev.deb meshlib_${{matrix.os}}-dev.deb
- name: Upload Ubuntu Developer Distribution
if: ${{ inputs.UPLOAD_ARTIFACTS && matrix.compiler == 'Clang' && matrix.config == 'Release'}}
uses: actions/upload-artifact@v4
with:
name: Distributives_${{matrix.os}}-x86
path: meshlib_${{matrix.os}}-dev.deb
retention-days: 1