-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
70 lines (66 loc) · 1.92 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
variables:
GIT_STRATEGY: clone
stages:
- test
- deploy
.virtenv: &virtualenv
- source /work/f_jwsb/software/miniforge3/etc/profile.d/conda.sh
# This is the environment where I installed all dependencies.
- conda activate lk_ci_python3.12
# To make things faster, re-use existing site packages.
- python -m venv virtualenv --system-site-packages
- source virtualenv/bin/activate
# Python's venv comes with an older version of pip, so update it.
- pip install --upgrade pip
# Check python version
- which python
- which pytest
# Check MPI
- which mpiexec
# Check location
- pwd
LongTermContinuousIntegration:
stage: test
timeout: 3 hours
coverage: '/^TOTAL.+?(\d+\%)$/'
tags:
- lk
script:
# Set-up the environement
- *virtualenv
# Install with -e (in editable mode) to allow the tracking of the test coverage
- pip install -e .[test,extras]
- pip list
# Get the examples repository
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.dlr.de/loads-kernel/loads-kernel-examples.git
# Run the actual testing of the code with pytest
# Using python -m pytest is necessary because pytest has the habit of not looking in the site-packages of the venv
- python -m pytest -v --basetemp=./tmp --cov=loadskernel --cov=modelviewer --cov=loadscompare --junitxml=testresult.xml
# Create some reports
- coverage report
- coverage xml -o coverage.xml
- coverage html --directory ./coverage
artifacts:
when: always
paths:
- coverage.xml
- testresult.xml
- coverage
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
junit: testresult.xml
deploy-pages:
stage: deploy
tags:
- lk
dependencies:
- LongTermContinuousIntegration
script:
- mkdir public
# Publish the coverage htlm results
- mv coverage ./public/coverage
artifacts:
paths:
- public