-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
107 lines (92 loc) · 5.9 KB
/
.gitlab-ci.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
stages:
- test
- deploy
before_script:
# display centos version
- cat /etc/issue
- ./get_dependencies.sh
- cd deps/LoadEnv && ./get_dependencies.sh
- cd -
base_python_test:
stage: test
timeout: 30s
variables:
VALID_GC_INI_FILES: '--config-specs tests/supporting_files/test-config-specs.ini --supported-config-flags tests/supporting_files/test-supported-config-flags.ini --supported-systems tests/supporting_files/test-supported-systems.ini --supported-envs tests/supporting_files/test-supported-envs.ini --environment-specs tests/supporting_files/test-environment-specs.ini'
GENCONFIG_CI_BYPASS_SUBSHELL_CHECK: 'true'
script:
# Base python setup
- python3 -m venv ./base_python_test
- source ./base_python_test/bin/activate
# Test help options
- source gen-config.sh --help
- source gen-config.sh -h
- source gen-config.sh --list-configs -h
# Test list options WITHOUT path to src
- ls -lat deps/LoadEnv/ini_files
- source gen-config.sh --list-configs --force rhel7 $VALID_GC_INI_FILES
- source gen-config.sh --list-config-flags --force rhel7 $VALID_GC_INI_FILES
# Setup for testing CMake fragment generation
- rm -rf tmp/; true
- mkdir tmp; true
- cd tmp; true
# Test help options WITH path to src
- source ../gen-config.sh --help ../
- source ../gen-config.sh -h ../
- source ../gen-config.sh --list-configs -h ../
# Test list options WITH path to src
- source ../gen-config.sh --list-configs --force rhel7 --config-specs ../tests/supporting_files/test-config-specs.ini --supported-config-flags ../tests/supporting_files/test-supported-config-flags.ini --supported-systems ../tests/supporting_files/test-supported-systems.ini --supported-envs ../tests/supporting_files/test-supported-envs.ini --environment-specs ../tests/supporting_files/test-environment-specs.ini ../
- source ../gen-config.sh --list-config-flags --force rhel7 --config-specs ../tests/supporting_files/test-config-specs.ini --supported-config-flags ../tests/supporting_files/test-supported-config-flags.ini --supported-systems ../tests/supporting_files/test-supported-systems.ini --supported-envs ../tests/supporting_files/test-supported-envs.ini --environment-specs ../tests/supporting_files/test-environment-specs.ini ../
# Test CMake fragment generations
- bash -c 'source ../gen-config.sh --ci-mode --force rhel7_cuda --config-specs ../tests/supporting_files/test-config-specs.ini --supported-config-flags ../tests/supporting_files/test-supported-config-flags.ini --supported-systems ../tests/supporting_files/test-supported-systems.ini --supported-envs ../tests/supporting_files/test-supported-envs.ini --environment-specs ../tests/supporting_files/test-environment-specs.ini --cmake-fragment tmp.cmake ../; ret=$?; if [[ $ret -eq 0 && -f ./tmp.cmake ]]; then exit 0; else exit 1; fi'
# Test --yes options and invalid environment specs ini file
- bash -c 'source ../gen-config.sh --yes --ci-mode --config-specs ../tests/supporting_files/test-config-specs.ini --supported-config-flags ../tests/supporting_files/test-supported-config-flags.ini --supported-systems ../tests/supporting_files/test-supported-systems.ini --supported-envs ../tests/supporting_files/test-supported-envs.ini --environment-specs ../tests/supporting_files/test-environment-specs-invalid.ini --cmake-fragment tmp.cmake --force rhel7_invalid ../; ret=$?; if [[ $ret -ne 0 ]]; then exit 0; else exit 1; fi'
# Test -y option and invalid config specs ini file
- bash -c 'source ../gen-config.sh -y --ci-mode --config-specs ../tests/supporting_files/test-config-specs-invalid2.ini --supported-config-flags ../tests/supporting_files/test-supported-config-flags.ini --supported-systems ../tests/supporting_files/test-supported-systems.ini --supported-envs ../tests/supporting_files/test-supported-envs.ini --environment-specs ../tests/supporting_files/test-environment-specs.ini --cmake-fragment tmp.cmake --force rhel7_invalid2 ../; ret=$?; if [[ $ret -ne 0 ]]; then exit 0; else exit 1; fi'
# Test early termination in sub-shell (TRILFRAME-290)
- bash -c 'unset GENCONFIG_CI_BYPASS_SUBSHELL_CHECK; source ../gen-config.sh --help ../ | tee gen-config.out; ret=$PIPESTATUS; if [[ $ret -ne 0 ]]; then exit 0; else exit 1; fi'
- deactivate
pytest:
stage: test
timeout: 20m
before_script:
# Pull required packages
# See https://pip.pypa.io/en/stable/reference/pip_install/#git : useful data on how to format this link
# https://stackoverflow.com/a/35998253/2059999 : also useful for some info on how to write the target
- python3 -m pip install --user -U py pytest pytest-cov
# display centos version
- cat /etc/issue
- ./get_dependencies.sh
script:
- python3 -m pytest --color=yes -rs -vv --cov=. --cov-report term --cov-config=.coveragerc
coverage: '/TOTAL\s*[0-9]*\s*[0-9]*\s*(\d+%)/'
sphinx:
stage: test
timeout: 20m
script:
- cd doc/
- python3 -s -m pip install -U --user -r requirements.txt
- bash make_html_docs.sh
publish coverage:
stage: deploy
timeout: 20m
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
# - find . -name '__pycache__' -exec rm -rf {} \; > /dev/null 2>&1
- python3 -m pytest --color=yes -rs -vv --cov=. --cov-report html --cov-report term --cov-config=.coveragerc
- rm -rf /home/trilinos/html_files/GenConfig/coverage
- mkdir -p /home/trilinos/html_files/GenConfig/coverage
- mv tests/htmlcov/* /home/trilinos/html_files/GenConfig/coverage/
coverage: '/TOTAL\s*[0-9]*\s*[0-9]*\s*(\d+%)/'
publish docs:
stage: deploy
timeout: 20m
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- cd doc/
- python3 -s -m pip install -U --user -r requirements.txt
- bash make_html_docs.sh
- rm -rf /home/trilinos/html_files/GenConfig/doc
- mkdir -p /home/trilinos/html_files/GenConfig/doc
- mv html/* /home/trilinos/html_files/GenConfig/doc/