Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 64c33858 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

Update docker environmnent

parent 0f85e4de
No related branches found
No related tags found
1 merge request!26Update docker environment
image: registry.gitlab.inria.fr/solverstack/docker/distrib
stages: stages:
- pre - pre
- build - build
- test - test
- analyze - analyze
default:
image: registry.gitlab.inria.fr/solverstack/docker/base
tags: ['ci.inria.fr', 'linux', 'small'] # gitlab instance runner (i.e. docker on linux)
interruptible: true
before_script: before_script:
- git config --global --add safe.directory $CI_PROJECT_DIR - git config --global --add safe.directory $CI_PROJECT_DIR
- git submodule update --init --recursive - git submodule update --init --recursive
.only-master-mr: .only-master-mr:
interruptible: true
rules: rules:
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^ci-.*$/) - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^ci-.*$/)
- if: ($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME !~ /^notest-.*$/) - if: ($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME !~ /^notest-.*$/)
.only-mr: .only-mr:
interruptible: true
rules: rules:
- if: ($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME !~ /^notest-.*$/) - if: ($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME !~ /^notest-.*$/)
preliminary_checks: preliminary_checks:
stage: pre stage: pre
tags: ["docker", "large"]
interruptible: true
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "merge_request_event"
parallel: parallel:
...@@ -35,7 +34,6 @@ preliminary_checks: ...@@ -35,7 +34,6 @@ preliminary_checks:
hqr_build_linux: hqr_build_linux:
stage: build stage: build
tags: ["docker", "large"]
extends: .only-master-mr extends: .only-master-mr
variables: variables:
SYSTEM: linux SYSTEM: linux
...@@ -43,7 +41,7 @@ hqr_build_linux: ...@@ -43,7 +41,7 @@ hqr_build_linux:
- bash .gitlab/build.sh | tee hqr-build-linux.log - bash .gitlab/build.sh | tee hqr-build-linux.log
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes expire_in: 1 week
untracked: true untracked: true
hqr_build_macosx: hqr_build_macosx:
...@@ -56,7 +54,7 @@ hqr_build_macosx: ...@@ -56,7 +54,7 @@ hqr_build_macosx:
- bash .gitlab/build.sh | tee hqr-build-linux.log - bash .gitlab/build.sh | tee hqr-build-linux.log
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes expire_in: 1 week
paths: paths:
- hqr-build-linux.log - hqr-build-linux.log
cache: cache:
...@@ -76,7 +74,7 @@ hqr_build_windows: ...@@ -76,7 +74,7 @@ hqr_build_windows:
- bash -lc .gitlab/build.sh | tee hqr-build-linux.log - bash -lc .gitlab/build.sh | tee hqr-build-linux.log
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes expire_in: 1 week
paths: paths:
- hqr-build-linux.log - hqr-build-linux.log
cache: cache:
...@@ -86,7 +84,6 @@ hqr_build_windows: ...@@ -86,7 +84,6 @@ hqr_build_windows:
hqr_test_linux: hqr_test_linux:
stage: test stage: test
tags: ["docker", "large"]
extends: .only-master-mr extends: .only-master-mr
needs: [hqr_build_linux] needs: [hqr_build_linux]
variables: variables:
...@@ -96,14 +93,18 @@ hqr_test_linux: ...@@ -96,14 +93,18 @@ hqr_test_linux:
coverage: /^\s*lines......:\s*\d+.\d+\%/ coverage: /^\s*lines......:\s*\d+.\d+\%/
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes when: always
expire_in: 1 week
paths: paths:
- hqr-test-linux.log - hqr-test-linux.log
- junit.xml - junit.xml
- hqr.lcov - hqr.lcov
- hqr-coverage.xml - coverage.xml
reports: reports:
junit: junit.xml junit: junit.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
hqr_test_macosx: hqr_test_macosx:
stage: test stage: test
...@@ -116,7 +117,8 @@ hqr_test_macosx: ...@@ -116,7 +117,8 @@ hqr_test_macosx:
- bash .gitlab/test.sh | tee hqr-test-macosx.log - bash .gitlab/test.sh | tee hqr-test-macosx.log
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes when: always
expire_in: 1 week
paths: paths:
- hqr-test-macosx.log - hqr-test-macosx.log
reports: reports:
...@@ -139,7 +141,8 @@ hqr_test_windows: ...@@ -139,7 +141,8 @@ hqr_test_windows:
- bash .gitlab/test.sh | tee hqr-test-windows.log - bash .gitlab/test.sh | tee hqr-test-windows.log
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes when: always
expire_in: 1 week
paths: paths:
- hqr-test-windows.log - hqr-test-windows.log
reports: reports:
...@@ -151,8 +154,7 @@ hqr_test_windows: ...@@ -151,8 +154,7 @@ hqr_test_windows:
sonarqube: sonarqube:
stage: analyze stage: analyze
tags: ["docker", "large"] image: registry.gitlab.inria.fr/solverstack/docker/analysis
interruptible: true
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^ci-.*$/ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /^ci-.*$/
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME !~ /^notest-.*$/ - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME !~ /^notest-.*$/
...@@ -165,7 +167,7 @@ sonarqube: ...@@ -165,7 +167,7 @@ sonarqube:
- ./.gitlab/analysis.sh - ./.gitlab/analysis.sh
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
expire_in: 180 minutes expire_in: 1 week
paths: paths:
- filelist.txt - filelist.txt
- hqr-cppcheck.xml - hqr-cppcheck.xml
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
# - we consider to be in HQR's source code root # - we consider to be in HQR's source code root
# - we consider having the junit.xml file and the coverage file hqr-coverage.xml in the root directory # - we consider having the junit.xml file and the coverage file hqr-coverage.xml in the root directory
# - we consider having cppcheck, rats, sonar-scanner programs available in the environment # - we consider having cppcheck, rats, sonar-scanner programs available in the environment
set -e
set -x
if [ $# -gt 0 ] if [ $# -gt 0 ]
then then
BUILDDIR=$1 BUILDDIR=$1
...@@ -30,7 +31,7 @@ git ls-files | grep "\.[ch]$" > filelist.txt ...@@ -30,7 +31,7 @@ git ls-files | grep "\.[ch]$" > filelist.txt
export UNDEFINITIONS="-UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus" export UNDEFINITIONS="-UWIN32 -UWIN64 -U_MSC_EXTENSIONS -U_MSC_VER -U__SUNPRO_C -U__SUNPRO_CC -U__sun -Usun -U__cplusplus"
# run cppcheck analysis # run cppcheck analysis
cppcheck -v -f --project=build/compile_commands.json --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS} ${DEFINITIONS} --file-list=./filelist.txt 2> hqr-cppcheck.xml cppcheck -v -f --project=build/compile_commands.json --language=c --platform=unix64 --enable=all --xml --xml-version=2 --suppress=missingInclude ${UNDEFINITIONS} ${DEFINITIONS} 2> hqr-cppcheck.xml
# run rats analysis # run rats analysis
rats -w 3 --xml `cat filelist.txt` > hqr-rats.xml rats -w 3 --xml `cat filelist.txt` > hqr-rats.xml
......
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
fatal() {
echo "$0: error occurred, exit"
exit 1
}
set -x set -x
if [[ "$SYSTEM" == "linux" ]]; then if [[ "$SYSTEM" == "linux" ]]; then
...@@ -13,14 +8,14 @@ if [[ "$SYSTEM" == "linux" ]]; then ...@@ -13,14 +8,14 @@ if [[ "$SYSTEM" == "linux" ]]; then
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install \ cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install \
-DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=ON \ -DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_C_FLAGS="-O0 -g -fPIC --coverage -Wall -fdiagnostics-show-option -fno-inline" \ -DCMAKE_C_FLAGS="-O0 -g -fPIC --coverage -Wall -fdiagnostics-show-option -fno-inline" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON || fatal -DCMAKE_EXE_LINKER_FLAGS="--coverage" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
else else
# no coverage analysis on other platforms # no coverage analysis on other platforms
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install \ cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install \
-DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=ON || fatal -DBUILD_SHARED_LIBS=ON -DCMAKE_VERBOSE_MAKEFILE=ON
fi fi
cmake --build build -j 4 || fatal cmake --build build -j 4
cmake --install build || fatal cmake --install build
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
fatal() {
echo "$0: error occurred, exit"
exit 1
}
set -x set -x
if [[ "$SYSTEM" == "linux" ]]; then if [[ "$SYSTEM" == "linux" ]]; then
source install/bin/hqr_env.sh || fatal source install/bin/hqr_env.sh
fi fi
cd build cd build
if [[ "$SYSTEM" == "windows" ]]; then if [[ "$SYSTEM" == "windows" ]]; then
...@@ -16,12 +11,12 @@ if [[ "$SYSTEM" == "windows" ]]; then ...@@ -16,12 +11,12 @@ if [[ "$SYSTEM" == "windows" ]]; then
export PATH="/c/Windows/WinSxS/x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_10.0.19041.1_none_21374cb0681a6320":$PATH export PATH="/c/Windows/WinSxS/x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_10.0.19041.1_none_21374cb0681a6320":$PATH
export PATH=$PWD/src:$PATH export PATH=$PWD/src:$PATH
fi fi
ctest --output-on-failure --no-compress-output -T Test --output-junit ../junit.xml || fatal ctest --output-on-failure --no-compress-output -T Test --output-junit ../junit.xml
if [[ "$SYSTEM" == "linux" ]]; then if [[ "$SYSTEM" == "linux" ]]; then
# clang is used on macosx and it is not compatible with --coverage option # clang is used on macosx and it is not compatible with --coverage option
# so that we can only make the coverage report on the linux runner with gcc # so that we can only make the coverage report on the linux runner with gcc
cd .. cd ..
lcov --capture --directory build -q --output-file hqr.lcov lcov --capture --directory build -q --output-file hqr.lcov
lcov --summary hqr.lcov lcov --summary hqr.lcov
lcov_cobertura hqr.lcov --output hqr-coverage.xml lcov_cobertura hqr.lcov --output coverage.xml
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment