-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
143 lines (143 loc) · 4.8 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
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
# azure-pipelines.yml - configuration for Azure Pipelines
# Copyright (C) 2020-2021 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
---
variables:
package.name: cppunitx
package.version: 1-alpha.6
upload.repository: kazssym/cppunitx
trigger:
- master
- release/*
stages:
- stage: Default
jobs:
- job: Build
pool:
vmImage: ubuntu-latest
variables:
- group: gpg
steps:
- task: DownloadSecureFile@1
name: Keys
inputs:
secureFile: keys.asc
- bash: |
echo '$(gpg.passphrase)' |
sh ./setupkeys.sh '$(Keys.secureFilePath)'
displayName: Set up signing keys
- task: SonarCloudPrepare@1
inputs:
SonarCloud: sonarcloud
organization: vx68k
scannerMode: CLI
extraProperties: |
sonar.projectVersion=$(package.version)
sonar.cfamily.build-wrapper-output=build-wrapper-output
sonar.cfamily.gcov.reportsPath=.
sonar.cfamily.threads=2
sonar.cfamily.cache.enabled=false
- bash: |
curl -OL https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip &&
unzip build-wrapper-linux-x86.zip
displayName: Download SonarCloud build wrapper
workingDirectory: $(Agent.TempDirectory)
- bash: |
sudo apt-get install -q --no-install-recommends \
texinfo
displayName: Install build dependencies
- bash: |
autoreconf --verbose
displayName: Bootstrap
- bash: |
./configure --disable-static \
CXX="g++ -std=c++11" \
CFLAGS="-g -O2 -fprofile-arcs -ftest-coverage" \
CXXFLAGS="-g -O2 -fprofile-arcs -ftest-coverage"
status=$?
echo "##vso[task.uploadfile]`pwd`/config.log"
exit $status
displayName: Configure
- bash: |
'$(Agent.TempDirectory)'/build-wrapper-linux-x86/build-wrapper-linux-x86-64 \
--out-dir build-wrapper-output \
make check
displayName: Build
- task: PublishTestResults@2
condition: succeededOrFailed()
- bash: |
for subdir in libcppunitx cppunitx test; do
(cd "$subdir" && find . -name '*.gcda' -print | xargs -r gcov -r)
done
displayName: Produce test coverage reports
- task: SonarCloudAnalyze@1
- bash: |
make dist &&
mkdir -p _dist &&
mv -f '$(package.name)-$(package.version)'.* _dist/
displayName: Make distributables
- publish: _dist
artifact: dist
- stage: Test
jobs:
- job: Build
strategy:
matrix:
Ubuntu:
VM_IMAGE: ubuntu-18.04
CC: gcc
CXX: g++
macOS:
VM_IMAGE: macOS-10.14
CC: clang
CXX: clang++ -std=c++11
continueOnError: true
pool:
vmImage: $(VM_IMAGE)
steps:
- checkout: none
- download: current
artifact: dist
- bash: |
gzip -dc '$(Agent.BuildDirectory)'/dist/'$(package.name)-$(package.version)'.tar.gz |
tar -x --strip-components=1
displayName: Unpack
- bash: |
$CC --version
$CXX --version
./configure --prefix='$(Build.BinariesDirectory)'
status=$?
echo "##vso[task.uploadfile]`pwd`/config.log"
exit $status
displayName: Configure
- bash: |
make check
displayName: Build
- bash: |
make install &&
make installcheck
displayName: Install
- stage: Release
dependsOn: Default
condition:
and(succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))
jobs:
- job: UploadToBitbucket
displayName: Upload to Bitbucket
pool:
vmImage: ubuntu-latest
variables:
- group: bitbucket
steps:
- download: current
artifact: dist
- bash: |
sh ./upload.sh \
-u '$(bitbucket.username):$(bitbucket.password)' \
-r '$(upload.repository)' \
'$(Agent.BuildDirectory)'/dist/'$(package.name)-$(package.version)'.*
displayName: Upload