This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathazure-pipelines.yml
93 lines (81 loc) · 2.92 KB
/
azure-pipelines.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
# Copyright (c) Bosch Software Innovations GmbH 2019.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v20.html
#
# SPDX-License-Identifier: EPL-2.0
trigger:
branches:
include:
- '*'
variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
pool:
vmImage: 'ubuntu-latest'
container: 'maven:3.6-jdk-8-slim'
steps:
# this has to be done first on the clean clone
- task: Bash@3
displayName: 'test for licenseHeaders'
inputs:
targetType: 'inline'
script: '.ci-scripts/test-for-licenseHeaders.sh --no-git'
# The following task is currently in beta state and actually not recommended for productive use
# related documentation: https://docs.microsoft.com/en-us/azure/devops/pipelines/caching/?view=azure-devops#maven
- task: CacheBeta@0
displayName: Cache Maven local repo
inputs:
key: $(Build.SourcesDirectory)/pom.xml
path: $(MAVEN_CACHE_FOLDER)
- task: Bash@3
displayName: 'Write settings.xml, pointing to custom local repository'
inputs:
targetType: 'inline'
script: |
mkdir -p $HOME/.m2
echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">' > $HOME/.m2/settings.xml
echo '<localRepository>$(Pipeline.Workspace)/.m2/repository</localRepository>' >> $HOME/.m2/settings.xml
echo '</settings>' >> $HOME/.m2/settings.xml
- task: Maven@3
displayName: 'mvn install'
inputs:
mavenPomFile: 'pom.xml'
goals: 'install'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
mavenOptions: $(MAVEN_OPTS)
mavenVersionOption: 'Default'
mavenAuthenticateFeed: false
sonarQubeRunAnalysis: false
checkStyleRunAnalysis: true
pmdRunAnalysis: true
findBugsRunAnalysis: true
- task: Bash@3
displayName: 'test example project with maven'
inputs:
targetType: 'inline'
script: '.ci-scripts/test-ExampleTestProject-with-maven.sh'
- task: Bash@3
displayName: 'test example project with cli'
inputs:
targetType: 'inline'
script: '.ci-scripts/test-ExampleTestProject-with-CLI.sh'
- task: Bash@3
displayName: 'test example project with gradle'
inputs:
targetType: 'inline'
script: '.ci-scripts/test-ExampleTestProject-with-gradle.sh'
- task: Bash@3
displayName: 'static code analysis'
inputs:
targetType: 'inline'
script: '.ci-scripts/test-run-all-static-code-analysis.sh'
- task: Bash@3
displayName: 'site-tests in antenna-documentation'
inputs:
targetType: 'inline'
script: '.ci-scripts/test-antenna-documentation-site-tests.sh'