-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
110 lines (108 loc) · 3.99 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
trigger:
- main
pool:
vmImage: 'windows-2019'
jobs:
- job: Formatting
steps:
- script: |
pip install cmake-format
npm install -g clang-format
displayName: 'Installs Dependencies'
- script: |
make format
displayName: 'Runs the formatting command'
- script: |
git diff --exit-code
displayName: 'Verify that all the sources have already been formatted'
- job: Pomodoro
strategy:
matrix:
ubuntu_debug:
imageName: 'ubuntu-18.04'
generator: Unix Makefiles
build_configuration: 'Debug'
cppcheck: 'OFF' # The version of cppcheck on Ubuntu is too old (1.82)
clang_tidy: 'ON'
ubuntu_release:
imageName: 'ubuntu-18.04'
generator: Unix Makefiles
build_configuration: 'Release'
cppcheck: 'OFF' # The version of cppcheck on Ubuntu is too old (1.82)
clang_tidy: 'ON'
mac_debug:
imageName: 'macOS-10.15'
generator: Xcode
build_configuration: 'Debug'
cppcheck: 'OFF'
clang_tidy: 'OFF'
mac_release:
imageName: 'macOS-10.15'
generator: Xcode
build_configuration: 'Release'
cppcheck: 'OFF'
clang_tidy: 'OFF'
windows_debug:
imageName: 'windows-2019'
generator: Visual Studio 16 2019
build_configuration: 'Debug'
cppcheck: 'ON'
clang_tidy: 'OFF'
windows_release:
imageName: 'windows-2019'
generator: Visual Studio 16 2019
build_configuration: 'Release'
cppcheck: 'ON'
clang_tidy: 'OFF'
pool:
vmImage: $(imageName)
steps:
- script: |
choco install conan cppcheck
refreshenv
displayName: 'Installs Dependencies (Windows_NT)'
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Windows_NT'))
- script: |
pip3 install conan
brew install cppcheck
displayName: 'Installs Dependencies (Darwin)'
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Darwin'))
- script: |
sudo apt-get update -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 1
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-10 1
sudo update-alternatives --set gcc "/usr/bin/gcc-10"
sudo update-alternatives --set g++ "/usr/bin/g++-10"
sudo update-alternatives --set gcov "/usr/bin/gcov-10"
pip3 install pip --upgrade
pip3 install setuptools
pip3 install conan==1.32.1
pip3 install git+https://github.com/eddyxu/cpp-coveralls.git
sudo apt-get install cppcheck clang-tidy libgl1-mesa-dev
displayName: 'Installs Dependencies (Linux)'
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))
- script: |
mkdir -p build
cd build
cmake .. -G "$(generator)" -DCMAKE_BUILD_TYPE=$(build_configuration) -DRUN_CPPCHECK=$(cppcheck) -DRUN_CLANG_TIDY=$(clang_tidy)
displayName: 'Generates the Solution'
- script: |
cd build
cmake --build . --config $(build_configuration)
displayName: 'Compiles the solution in $(build_configuration) Configuration'
- script: |
cd build
ctest -C $(build_configuration) -T Test --output-on-failure
displayName: 'Runs the tests in $(build_configuration) configuration'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'cTest'
testResultsFiles: 'build/Testing/*/Test.xml'
- script: |
export TRAVIS_BRANCH=$(System.PullRequest.SourceBranch)
/home/vsts/.local/bin/coveralls -E tst -E build
displayName: 'Sends code coverage to Coveralls'
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['build_configuration'], 'Debug'))
env:
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)