Newer
Older
##
## PeTrack - Software for tracking pedestrians movement in videos
## Copyright (C) 2010-2020 Forschungszentrum Jülich GmbH,
## Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
## Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
##
Schrödter, Tobias
committed
- build_environment
- build_installer
- deploy
Schrödter, Tobias
committed
###############################################################################
# Linux CI
###############################################################################
# Build environment for building and testing the program. Uses the Dockerfile
# from the repository
build_container:
stage: build_environment
Schrödter, Tobias
committed
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/container/ubuntu/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}_linux
Schrödter, Tobias
committed
rules:
- changes:
pre-build-checks:
image: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}_linux
stage: pre-build-checks
script:
- scripts/check-format-cpp.sh
Schrödter, Tobias
committed
# Build petrack and petrack unit_tests
build_linux:
image: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}_linux
stage: build
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_UNIT_TESTS=ON -G Ninja
- cmake --build .
Schrödter, Tobias
committed
artifacts:
paths:
- "./build/"
expire_in: 2 hrs
# Execute unit tests
unit_test_linux:
image: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}_linux
stage: test
script:
- cd build/tests/unit_test
- ./petrack_tests -platform offscreen -r junit -o unit_test_report.xml
artifacts:
when: always
paths:
Schrödter, Tobias
committed
reports:
junit: "build/tests/unit_test/unit_test_report.xml"
Schrödter, Tobias
committed
regression_test_linux:
image: $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}_linux
stage: test
script:
- cd tests/regression_test/tests
- python3 -m pytest --path=../../../build/petrack --junitxml=pytest_report.xml | tee "RegressionTestLog.txt"
artifacts:
when: on_failure
paths:
- "tests/regression_test/tests/RegressionTestLog.txt"
reports:
junit: "tests/regression_test/tests/pytest_report.xml"
Schrödter, Tobias
committed
###############################################################################
# Windows CI
###############################################################################
# Build petrack and petrack unit_tests
Schrödter, Tobias
committed
- $env:Path += ";C:\Program Files\CMake\bin"
- cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_UNIT_TESTS=ON -DUSE_3RD_PARTY=ON ..
- cmake --build . -- -j6
artifacts:
paths:
- "./build/petrack.exe"
- "./build/tests/unit_test/petrack_tests.exe"
Schrödter, Tobias
committed
# Execute unit tests
unit_test_windows:
Schrödter, Tobias
committed
- cd build/tests/unit_test
- ./petrack_tests.exe -r junit -o unit_test_report.xml
Schrödter, Tobias
committed
when: always
Schrödter, Tobias
committed
junit: "build/tests/unit_test/unit_test_report.xml"
Schrödter, Tobias
committed
# Ggf. muss man nicht in den Ordner der Testskripte verzweigen, da PyTest auch rekusrsiv in Unterorndern nach tests sucht
regression_test_windows:
stage: test
tags:
- windows
script:
Schrödter, Tobias
committed
- cd tests/regression_test/tests
- python -m pytest --junitxml=pytest_report.xml | Tee-Object -FilePath "RegressionTestLog.txt"
Schrödter, Tobias
committed
when: on_failure
Schrödter, Tobias
committed
- "tests/regression_test/tests/RegressionTestLog.txt"
Schrödter, Tobias
committed
junit: "tests/regression_test/tests/pytest_report.xml"
stage: build_installer
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
tags:
- windows
script:
- mkdir -Force build
- $env:Path += ";C:\Program Files\CMake\bin"
- cd build
- Remove-Item -Force -Recurse -Path *
- cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_UNIT_TESTS=ON -DUSE_3RD_PARTY=ON ..
- cpack -C Release
artifacts:
paths:
- "build/petrack-installer-*"
expire_in: 2hrs
d.kilic
committed
dependencies: []
image: alpine
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- apk --no-cache add curl
- cd build
- winInst=$(echo petrack-installer-*)
- curl -k -T $winInst -u "${SCIEBO_WIN_INSTALLER_PATH}:" https://fz-juelich.sciebo.de/public.php/webdav/$winInst
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
###############################################################################
# MacOS CI
###############################################################################
# Build petrack and petrack unit_tests
build_macos:
stage: build
tags:
- macos
script:
- mkdir build
- cd build
- cmake -G Ninja .. -DBUILD_BUNDLE=ON -DBUILD_UNIT_TESTS=ON -DCMAKE_PREFIX_PATH=/Users/tobias/programs/petrack-deps -DCatch2_DIR=/Users/tobias/programs/petrack-deps/lib/cmake/Catch2/ -Dtrompeloeil_DIR=/Users/tobias/programs/petrack-deps/lib/cmake/trompeloeil/
- cmake --build .
- cpack -C Release -G DragNDrop --verbose
- rm -r petrack.app
- find _CPack_Packages/ -type d -name "petrack.app" | xargs -I _ cp -r _ petrack.app
artifacts:
paths:
- "./build/"
expire_in: 2 hrs
## Execute unit tests
unit_test_macos:
stage: test
tags:
- macos
script:
- cd build/tests/unit_test
- ./petrack_tests -r junit -o unit_test_report.xml
artifacts:
when: always
paths:
- build/tests/unit_test/unit_test_report.xml
reports:
junit: "build/tests/unit_test/unit_test_report.xml"
needs: ["build_macos"]
## Execute regression tests
regression_test_macos:
stage: test
tags:
- macos
script:
- cd tests/regression_test/tests
- python3 -m pytest --path=../../../build/petrack.app/Contents/MacOS/petrack --junitxml=pytest_report.xml | tee "RegressionTestLog.txt"
artifacts:
when: on_failure
paths:
- "tests/regression_test/tests/RegressionTestLog.txt"
reports:
junit: "tests/regression_test/tests/pytest_report.xml"
needs: ["build_macos"]
build_installer_macos:
stage: build_installer
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
tags:
- macos
script:
- cd build
artifacts:
paths:
- "build-bundle/petrack-installer-*"
expire_in: 2hrs
d.kilic
committed
dependencies:
- build_macos
make_release_macos:
image: alpine
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
needs: ["build_installer_macos"]
script:
- apk --no-cache add curl
- cd build-bundle
- macosInst=$(echo petrack-installer-*)
- curl -k -T $macosInst -u "${SCIEBO_MACOS_INSTALLER_PATH}:" https://fz-juelich.sciebo.de/public.php/webdav/$macosInst