Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PeTrack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pedestrian Dynamics Empiricism
PeTrack
Merge requests
!10
Add code quality
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Add code quality
test-code-quality
into
master
Overview
0
Commits
2
Pipelines
0
Changes
1
Closed
d.kilic
requested to merge
test-code-quality
into
master
4 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
9d07eb1c
2 commits,
4 years ago
1 file
+
21
−
98
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
.gitlab-ci.yml
+
21
−
98
Options
stages
:
-
build_environment
-
build
-
test
###############################################################################
# Linux CI
###############################################################################
# Build environment for building and testing the program. Uses the Dockerfile
# from the repository
build_container
:
stage
:
build_environment
image
:
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/arch/Dockerfile --destination $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG}_linux
rules
:
-
changes
:
-
$CI_PROJECT_DIR/container/arch/Dockerfile
# 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
-
cmake --build . -- -j4
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
:
-
build/tests/unit_test/unit_test_report.xml
reports
:
junit
:
"
build/tests/unit_test/unit_test_report.xml"
###############################################################################
# Windows CI
###############################################################################
# Build petrack and petrack unit_tests
build_windows
:
stage
:
build
tags
:
-
windows
script
:
-
mkdir -Force build
-
$env:Path += ";C:\Program Files\CMake\bin"
-
cd build
-
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"
expire_in
:
2 hrs
# Execute unit tests
unit_test_windows
:
stage
:
test
tags
:
-
windows
script
:
-
cd build/tests/unit_test
-
./petrack_tests.exe -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_windows"
]
# 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
-
code
code_quality
:
stage
:
code
image
:
docker:stable
allow_failure
:
true
services
:
-
docker:stable-dind
variables
:
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
"
"
script
:
-
cd tests/regression_test/tests
-
python -m pytest --junitxml=pytest_report.xml | Tee-Object -FilePath "RegressionTestLog.txt"
-
docker run
--env CODECLIMATE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
--volume /tmp/cc:/tmp/cc
codeclimate/codeclimate:0.85.2 analyze -f json > report.json
artifacts
:
when
:
on_failure
paths
:
-
"
tests/regression_test/tests/RegressionTestLog.txt"
reports
:
junit
:
"
tests/regression_test/tests/pytest_report.xml"
needs
:
[
"
build_windows"
]
codequality
:
report.json
except
:
variables
:
-
$CODE_QUALITY_DISABLED
Loading