-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
95 lines (86 loc) · 1.99 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
image: cmacmackin/fortran-env:ubuntu-latest
# Build your software, along with all tests
compile:
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=TESTING
- make
stage: build
artifacts:
paths:
- build/
expire_in: 1 week
# Try building documentation, but still run unit tests if fail
build_docs:
script:
- mkdir build
- cd build
- cmake ..
- make docs
stage: build
artifacts:
paths:
- build/docs/
expire_in: 1 day
allow_failure: true
# Run unit tests, producing a report on results
unit_tests:
script:
- cd build
- tests/unit_tests -robust -xml pfunit.xml -name UnitTests
- make gcovr
- mv gcovr unit_test_coverage
stage: test
coverage: '/^lines: (\d+.\d+)%/'
artifacts:
paths:
- build/unit_test_coverage/
expire_in: 1 week
# Version of GitLab runner currently available at CCFE does not support this
# reports:
# junit: pfunit.xml
# Run all tests, e.g. integration tests, in addition to unit tests
all_tests:
script:
- cd build
- ctest
- make gcovr
- mv gcovr all_test_coverage
stage: test
coverage: '/^lines: (\d+.\d+)%/'
artifacts:
paths:
- build/all_test_coverage/
expire_in: 1 week
# Test that cmake installs everything correctly so that programs can
# be executed and libraries linked to
install_test:
script:
- cd build
- make install
# Ensure that the program has installed in the PATH and runs
- which projectname
- projectname
# Try using these libraries in another cmake project
- cd tests/test_installation
- cmake .
- make
- ./test_program
stage: test
# Deploy documentation and code coverage reports to GitLab pages
pages:
script:
- mv build/docs public
- mv build/unit_test_coverage public/unit_coverage
- mv build/all_test_coverage public/all_coverage
stage: deploy
dependencies:
- build_docs
- unit_tests
- all_tests
artifacts:
paths:
- public/
only:
- master