Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ab8948f9 authored by hhakim's avatar hhakim
Browse files

Replace git command by only-changes gitlab ci rules.

The goal is to execute C++ test only when a change occurred in core or tests.
parent 9bd8d51f
Branches
Tags
No related merge requests found
...@@ -39,8 +39,9 @@ stages: ...@@ -39,8 +39,9 @@ stages:
ctest: ctest:
variables: {SLOW_TESTS: "OFF", BUILD_MULTITHREAD: "ON"} # the CDashConfScript is able to retrieve OpenMP_gomp_LIBRARY and OpenMP_INC_DIR from environment (it's necessary on macOS, so the runner's env. must be configured) variables: {SLOW_TESTS: "OFF", BUILD_MULTITHREAD: "ON"} # the CDashConfScript is able to retrieve OpenMP_gomp_LIBRARY and OpenMP_INC_DIR from environment (it's necessary on macOS, so the runner's env. must be configured)
script: script:
# C++ tests are executed only if something was modified in C++ lib or C++ tests - ctest -O ctest.log -S ./CDashConfScript.cmake -j4 --output-junit junit_output.xml
- if git log --oneline -n 1 --name-status | grep -E '\s+(src/|misc/test/src/C++)'; then ctest -O ctest.log -S ./CDashConfScript.cmake -j4 --output-junit junit_output.xml; misc/continuous_integration/jobs/junit_html_report.sh cpp_test_report; else echo 'nothing new to test in C++ code'; if grep -B 1 'Outcome:.*Failed' $(ls build*/cpp_test_report.html | tail -1) | sed -ne 's%.*Test case:.*<b>\(.*\)</b>.*%\1%p'; then exit 1; else echo "all tests passed"; exit 0;fi; fi - misc/continuous_integration/jobs/junit_html_report.sh cpp_test_report
- if grep -B 1 'Outcome:.*Failed' $(ls build*/cpp_test_report.html | tail -1) | sed -ne 's%.*Test case:.*<b>\(.*\)</b>.*%\1%p'; then exit 1; else echo "all tests passed"; exit 0; fi
except: except:
- schedules - schedules
- tags - tags
...@@ -52,6 +53,11 @@ ctest: ...@@ -52,6 +53,11 @@ ctest:
- $(ls -d build* | tail -1)/cpp_test_report.html - $(ls -d build* | tail -1)/cpp_test_report.html
when: always when: always
expire_in: '6 months' expire_in: '6 months'
only:
# C++ tests are executed only if something was modified in C++ lib or C++ tests
changes:
- src/**
- misc/test/src/C++/**
ctest_python: ctest_python:
before_script: before_script:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment