Skip to content

Commit

Permalink
ci: add azure pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
sztomi committed Oct 27, 2019
1 parent e1aa4e9 commit 7033580
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.12)
project(rpc VERSION 3.0.0)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
Expand Down
104 changes: 104 additions & 0 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
trigger:
- rpclib3

jobs:
- job:
displayName: 'Linux'

pool:
vmImage: 'ubuntu-latest'

strategy:
matrix:
Clang-9:
CC: clang-9
CXX: clang++-9

steps:
- task: 'UsePythonVersion@0'
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
curl -Ls https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip -o ninja-linux.zip
unzip ninja-linux.zip
sudo cp -v ninja /usr/local/bin/
pip3 install conan
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main"
sudo apt-get update
sudo apt-get install -y clang-9
displayName: 'Install Build Deps'
- script: |
mkdir build && cd build
conan install ..
cmake .. -G Ninja
displayName: 'Configure'
- script: |
cd build
ninja
displayName: 'Build'
- script: |
cd build
test/rpc-tests
displayName: 'Run unit tests'
- job:
displayName: 'Windows'

pool:
vmImage: 'vs2017-win2016'

steps:
- task: 'UsePythonVersion@0'
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
choco install ninja
pip3 install conan
displayName: 'Install Build Deps'
- script: |
mkdir build && cd build
conan install ..
cmake .. -G Ninja
displayName: 'Configure'
- script: |
cd build
ninja
displayName: 'Build'
- script: |
cd build
test/rpc-tests.exe
displayName: 'Run unit tests'
- job: macOS
pool:
vmImage: macos-10.13
steps:
- task: 'UsePythonVersion@0'
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: |
set -eu
curl -Ls https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip -o ninja-mac.zip
unzip ninja-mac.zip
sudo cp -v ninja /usr/local/bin/
pip install conan
displayName: 'Install Build Deps'
- script: |
mkdir build && cd build
conan install ..
cmake .. -G Ninja
displayName: 'Configure'
- script: |
cd build
ninja
displayName: 'Build'
- script: |
cd build
test/rpc-tests
displayName: 'Run unit tests'
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ add_executable(rpc-tests
base.cpp)

target_link_libraries(rpc-tests PRIVATE catch2::catch2)
set_target_properties(rpc-tests PROPERTIES CXX_STANDARD 17)
2 changes: 1 addition & 1 deletion test/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ unsigned int Factorial( unsigned int number ) {
TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( Factorial(1) == 1 );
REQUIRE( Factorial(2) == 2 );
REQUIRE( Factorial(3) == 5 );
REQUIRE( Factorial(3) == 6 );
REQUIRE( Factorial(10) == 3628800 );
}

0 comments on commit 7033580

Please sign in to comment.