Skip to content

Commit 216c90f

Browse files
authored
Merge pull request #3 from oatpp/better_ci
New Ubuntu build pipeline
2 parents 6537f58 + a1af0b8 commit 216c90f

File tree

4 files changed

+180
-10
lines changed

4 files changed

+180
-10
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ add_library(crud-lib
88
src/controller/UserController.hpp
99
src/db/UserDb.hpp
1010
src/dto/PageDto.hpp
11+
src/dto/StatusDto.hpp
1112
src/dto/UserDto.hpp
1213
src/service/UserService.cpp
1314
src/service/UserService.hpp
1415
src/AppComponent.hpp
1516
src/DatabaseComponent.hpp
1617
src/SwaggerComponent.hpp
17-
src/ErrorHandler.cpp src/ErrorHandler.hpp src/dto/StatusDto.hpp)
18+
src/ErrorHandler.cpp
19+
src/ErrorHandler.hpp)
1820

1921
## include directories
2022

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ This project is using the following oatpp modules:
4848

4949
#### Using CMake
5050

51-
**Requires**
51+
##### Pre Requirements
5252

53-
- `oatpp`, `oatpp-swagger` and `oatpp-sqlite` modules installed. You may run `utility/install-oatpp-modules.sh`
54-
script to install required oatpp modules.
53+
- `oatpp`
54+
- `oatpp-swagger`
55+
- `oatpp-sqlite` with `-DOATPP_SQLITE_AMALGAMATION=ON` cmake flag.
56+
57+
**Note:** You may run `utility/install-oatpp-modules.sh` script to install required oatpp modules.
58+
59+
##### Build Project
5560

5661
```
5762
$ mkdir build && cd build

azure-pipelines.yml

Lines changed: 165 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,115 @@ jobs:
99
continueOnError: false
1010
pool:
1111
vmImage: 'Ubuntu 16.04'
12-
container:
13-
image: lganzzzo/ubuntu-cmake:latest
1412
workspace:
1513
clean: all
1614
steps:
1715
- script: |
18-
sudo /bin/bash ./install-oatpp-modules.sh
19-
displayName: 'install oatpp modules'
20-
workingDirectory: utility
16+
mkdir build
17+
18+
#######################################################################################
19+
## Build oatpp
20+
- script: |
21+
git clone https://github.com/oatpp/oatpp
22+
mkdir -p oatpp/build
23+
displayName: 'Checkout - oatpp'
24+
workingDirectory: build
25+
- script: |
26+
cmake -DOATPP_BUILD_TESTS=OFF ..
27+
sudo make install
28+
displayName: 'Build - oatpp'
29+
workingDirectory: build/oatpp/build
30+
31+
#######################################################################################
32+
## Build oatpp-sqlite
33+
- script: |
34+
git clone https://github.com/oatpp/oatpp-sqlite
35+
mkdir -p oatpp-sqlite/build
36+
displayName: 'Checkout - oatpp-sqlite'
37+
workingDirectory: build
38+
- script: |
39+
cmake -DOATPP_SQLITE_AMALGAMATION=ON ..
40+
sudo make install
41+
displayName: 'Build - oatpp-sqlite'
42+
workingDirectory: build/oatpp-sqlite/build
43+
44+
#######################################################################################
45+
## Build oatpp-swagger
46+
- script: |
47+
git clone https://github.com/oatpp/oatpp-swagger
48+
mkdir -p oatpp-swagger/build
49+
displayName: 'Checkout - oatpp-swagger'
50+
workingDirectory: build
51+
- script: |
52+
cmake ..
53+
sudo make install
54+
displayName: 'Build - oatpp-swagger'
55+
workingDirectory: build/oatpp-swagger/build
56+
57+
#######################################################################################
58+
## Build Project
59+
- script: |
60+
cmake ..
61+
sudo make
62+
displayName: 'CMake'
63+
workingDirectory: build
64+
- script: |
65+
make test ARGS="-V"
66+
displayName: 'Test'
67+
workingDirectory: build
68+
69+
- job: macOS
70+
displayName: 'Build - macOS'
71+
continueOnError: false
72+
pool:
73+
vmImage: 'macOS-10.14'
74+
workspace:
75+
clean: all
76+
steps:
2177
- script: |
2278
mkdir build
79+
80+
#######################################################################################
81+
## Build oatpp
82+
- script: |
83+
git clone https://github.com/oatpp/oatpp
84+
mkdir -p oatpp/build
85+
displayName: 'Checkout - oatpp'
86+
workingDirectory: build
87+
- script: |
88+
cmake -DOATPP_BUILD_TESTS=OFF ..
89+
sudo make install
90+
displayName: 'Build - oatpp'
91+
workingDirectory: build/oatpp/build
92+
93+
#######################################################################################
94+
## Build oatpp-sqlite
95+
- script: |
96+
git clone https://github.com/oatpp/oatpp-sqlite
97+
mkdir -p oatpp-sqlite/build
98+
displayName: 'Checkout - oatpp-sqlite'
99+
workingDirectory: build
100+
- script: |
101+
cmake -DOATPP_SQLITE_AMALGAMATION=ON ..
102+
sudo make install
103+
displayName: 'Build - oatpp-sqlite'
104+
workingDirectory: build/oatpp-sqlite/build
105+
106+
#######################################################################################
107+
## Build oatpp-swagger
108+
- script: |
109+
git clone https://github.com/oatpp/oatpp-swagger
110+
mkdir -p oatpp-swagger/build
111+
displayName: 'Checkout - oatpp-swagger'
112+
workingDirectory: build
113+
- script: |
114+
cmake ..
115+
sudo make install
116+
displayName: 'Build - oatpp-swagger'
117+
workingDirectory: build/oatpp-swagger/build
118+
119+
#######################################################################################
120+
## Build Project
23121
- script: |
24122
cmake ..
25123
sudo make
@@ -29,3 +127,65 @@ jobs:
29127
make test ARGS="-V"
30128
displayName: 'Test'
31129
workingDirectory: build
130+
131+
- job: windows
132+
displayName: 'Build - Windows'
133+
continueOnError: false
134+
pool:
135+
vmImage: 'windows-latest'
136+
workspace:
137+
clean: all
138+
steps:
139+
- script: |
140+
MD build
141+
142+
#######################################################################################
143+
## Build oatpp
144+
- script: |
145+
git clone https://github.com/oatpp/oatpp
146+
MD oatpp\build
147+
displayName: 'Checkout - oatpp'
148+
workingDirectory: build
149+
- script: |
150+
cmake -DOATPP_BUILD_TESTS=OFF ..
151+
cmake --build . --target INSTALL
152+
displayName: 'Build - oatpp'
153+
workingDirectory: build\oatpp\build
154+
155+
#######################################################################################
156+
## Build oatpp-sqlite
157+
- script: |
158+
git clone https://github.com/oatpp/oatpp-sqlite
159+
MD oatpp-sqlite\build
160+
displayName: 'Checkout - oatpp-sqlite'
161+
workingDirectory: build
162+
- script: |
163+
cmake -DOATPP_SQLITE_AMALGAMATION=ON ..
164+
cmake --build . --target INSTALL
165+
displayName: 'Build - oatpp-sqlite'
166+
workingDirectory: build\oatpp-sqlite\build
167+
168+
#######################################################################################
169+
## Build oatpp-swagger
170+
- script: |
171+
git clone https://github.com/oatpp/oatpp-swagger
172+
MD oatpp-swagger\build
173+
displayName: 'Checkout - oatpp-swagger'
174+
workingDirectory: build
175+
- script: |
176+
cmake ..
177+
cmake --build . --target INSTALL
178+
displayName: 'Build - oatpp-swagger'
179+
workingDirectory: build\oatpp-swagger\build
180+
181+
#######################################################################################
182+
## Build Project
183+
- script: |
184+
cmake ..
185+
cmake --build .
186+
displayName: 'CMake'
187+
workingDirectory: build
188+
- script: |
189+
crud-test.exe
190+
displayName: 'Test'
191+
workingDirectory: build\Debug

utility/install-oatpp-modules.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ cd $MODULE_NAME
3232
mkdir build
3333
cd build
3434

35-
cmake -DOATPP_DISABLE_ENV_OBJECT_COUNTERS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOATPP_BUILD_TESTS=OFF ..
35+
############################################################################
36+
## Flag '-DOATPP_SQLITE_AMALGAMATION=ON' used by oatpp-sqlite module only ##
37+
############################################################################
38+
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOATPP_BUILD_TESTS=OFF -DOATPP_SQLITE_AMALGAMATION=ON ..
3639
make install -j $NPROC
3740

3841
cd ../../

0 commit comments

Comments
 (0)