Skip to content

Commit 44b1afa

Browse files
committed
add changes for cpp-httplib-server with samples
1 parent 1d739f1 commit 44b1afa

10 files changed

Lines changed: 2415 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Samples cpp httplib server
2+
3+
on:
4+
push:
5+
branches:
6+
- "samples/server/petstore/cpp-httplib-server/**"
7+
pull_request:
8+
paths:
9+
- "samples/server/petstore/cpp-httplib-server/**"
10+
11+
env:
12+
GRADLE_VERSION: 6.9
13+
14+
jobs:
15+
build:
16+
name: Build cpp httplib server
17+
strategy:
18+
matrix:
19+
sample:
20+
- samples/server/petstore/cpp-httplib-server
21+
os:
22+
- ubuntu-latest
23+
- macOS-latest
24+
- windows-latest
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Install dependencies (Linux)
29+
if: matrix.os == 'ubuntu-latest'
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y nlohmann-json3-dev libssl-dev zlib1g-dev
33+
# Install httplib from source since it's not in Ubuntu repos
34+
git clone https://github.com/yhirose/cpp-httplib.git
35+
cd cpp-httplib
36+
mkdir build && cd build
37+
cmake .. -DCMAKE_BUILD_TYPE=Release
38+
make -j$(nproc)
39+
sudo make install
40+
- name: Install dependencies (macOS)
41+
if: matrix.os == 'macOS-latest'
42+
run: |
43+
brew install nlohmann-json openssl zlib
44+
# Install httplib via Homebrew
45+
brew install cpp-httplib
46+
- name: Install vcpkg (Windows)
47+
if: matrix.os == 'windows-latest'
48+
run: |
49+
git clone https://github.com/microsoft/vcpkg.git
50+
.\vcpkg\bootstrap-vcpkg.bat
51+
shell: cmd
52+
- name: Install dependencies (Windows)
53+
if: matrix.os == 'windows-latest'
54+
run: |
55+
.\vcpkg\vcpkg.exe install nlohmann-json:x64-windows openssl:x64-windows cpp-httplib:x64-windows zlib:x64-windows
56+
shell: cmd
57+
- name: Build
58+
working-directory: ${{ matrix.sample }}
59+
run: cmake -B build && cmake --build build --verbose
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
generatorName: cpp-httplib-server
2+
outputDir: samples/server/petstore/cpp-httplib-server
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-httplib-server/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/cpp-httplib-server
5+
additionalProperties:
6+
apiNamespace: "petstore::openapi::api"
7+
modelNamespace: "petstore::openapi::model"
8+
projectName: "petStoreProject"
9+
addApiImplStubs: true

0 commit comments

Comments
 (0)