-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy path.gitlab-ci.yml
146 lines (134 loc) · 4.24 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
image: maven:latest
include:
- template: Code-Quality.gitlab-ci.yml
stages:
- build
- test
- visualize
- deploy
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
code_quality:
rules:
- if: '$CODE_QUALITY_DISABLED'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_TAG'
cache:
paths:
- ~/.m2/repository/
- .m2/repository/
- target/
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS compile
tags:
- general
test-nvidia-gpu:
image: aparapi/aparapi-nvidia:latest
stage: test
script:
- clinfo
- if [[ "$(clinfo | grep 'Device Type')" != *"GPU"* ]]; then exit -1; fi
- mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site
- mv target target-nvidia-gpu
artifacts:
when: always
reports:
junit:
- target-nvidia-gpu/surefire-reports/TEST-*.xml
- target-nvidia-gpu/failsafe-reports/TEST-*.xml
paths:
- target-nvidia-gpu
tags:
- opencl
test-nvidia-cpu:
image: aparapi/aparapi-nvidia:latest
stage: test
script:
- clinfo
- if [[ "$(clinfo | grep 'Device Type')" == *"GPU"* ]]; then exit -1; fi
- mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site
- mv target target-nvidia-cpu
artifacts:
when: always
reports:
junit:
- target-nvidia-cpu/surefire-reports/TEST-*.xml
- target-nvidia-cpu/failsafe-reports/TEST-*.xml
paths:
- target-nvidia-cpu
tags:
- compute
test-amdgpu-cpu:
image: aparapi/aparapi-amdgpu:latest
stage: test
script:
- clinfo
- if [[ "$(clinfo | grep 'Device Type')" == *"GPU"* ]]; then exit -1; fi
- mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site
- mv target target-amdgpu-cpu
artifacts:
when: always
reports:
junit:
- target-amdgpu-cpu/surefire-reports/TEST-*.xml
- target-amdgpu-cpu/failsafe-reports/TEST-*.xml
paths:
- target-amdgpu-cpu
tags:
- compute
test-pocl-cpu:
image: aparapi/aparapi-pocl:latest
stage: test
script:
- clinfo
- if [[ "$(clinfo | grep 'Device Type')" == *"GPU"* ]]; then exit -1; fi
- mvn $MAVEN_CLI_OPTS org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report site
- mv target target-pocl-cpu
artifacts:
when: always
reports:
junit:
- target-pocl-cpu/surefire-reports/TEST-*.xml
- target-pocl-cpu/failsafe-reports/TEST-*.xml
paths:
- target-pocl-cpu
tags:
- compute
coverage:
stage: visualize # Must be in a stage later than test-jdk11's stage. The visualize stage does not exist by default. Please define it first, or chose an existing stage like deploy.
image: haynes/jacoco2cobertura:1.0.3
script:
- 'python /opt/cover2cover.py target-nvidia-gpu/site/jacoco/jacoco.xml src/main/java > target-nvidia-gpu/site/cobertura.xml'
- 'python /opt/source2filename.py target-nvidia-gpu/site/cobertura.xml'
- 'python /opt/cover2cover.py target-nvidia-cpu/site/jacoco/jacoco.xml src/main/java > target-nvidia-cpu/site/cobertura.xml'
- 'python /opt/source2filename.py target-nvidia-cpu/site/cobertura.xml'
- 'python /opt/cover2cover.py target-amdgpu-cpu/site/jacoco/jacoco.xml src/main/java > target-amdgpu-cpu/site/cobertura.xml'
- 'python /opt/source2filename.py target-amdgpu-cpu/site/cobertura.xml'
- 'python /opt/cover2cover.py target-pocl-cpu/site/jacoco/jacoco.xml src/main/java > target-pocl-cpu/site/cobertura.xml'
- 'python /opt/source2filename.py target-pocl-cpu/site/cobertura.xml'
needs: ["test-nvidia-gpu", "test-nvidia-cpu", "test-amdgpu-cpu", "test-pocl-cpu"]
dependencies:
- test-nvidia-gpu
- test-nvidia-cpu
- test-amdgpu-cpu
- test-pocl-cpu
artifacts:
reports:
cobertura: target-nvidia-gpu/site/cobertura.xml
cobertura: target-nvidia-cpu/site/cobertura.xml
cobertura: target-amdgpu-cpu/site/cobertura.xml
cobertura: target-pocl-cpu/site/cobertura.xml
deploy:
stage: deploy
script:
- mvn $MAVEN_CLI_OPTS -DskipTests=true deploy
tags:
- general
only:
- master
- /^v.*$/