-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
258 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#name: build and test | ||
#on: [push, workflow_dispatch] | ||
# | ||
#jobs: | ||
# job: | ||
# name: ${{ matrix.os }}-${{ github.workflow }} | ||
# runs-on: ${{ matrix.os }} | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# os: [ubuntu-latest, macos-latest, windows-latest] | ||
# | ||
# steps: | ||
# - name: Checkout cpp-oasvalidator | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# submodules: true | ||
# fetch-depth: 0 | ||
# | ||
# - uses: lukka/get-cmake@latest | ||
# | ||
# - name: Run CMake Ninja build all release preset including example, unittests, perftests | ||
# uses: lukka/run-cmake@v10 | ||
# id: runcmake | ||
# with: | ||
# workflowPreset: 'release-all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Common Build and Test Steps | ||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ inputs.os }} | ||
steps: | ||
- name: Checkout cpp-oasvalidator | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- uses: lukka/get-cmake@latest | ||
|
||
- name: Run CMake Ninja build all release preset including example, unittests, perftests | ||
uses: lukka/run-cmake@v10 | ||
id: runcmake | ||
with: | ||
workflowPreset: 'build-test-and-example' | ||
|
||
- name: Run Example | ||
run: | | ||
if [ "${{ runner.os }}" = "Windows" ]; then | ||
build/release/example/oasvalidator-example.exe | ||
else | ||
build/release/example/oasvalidator-example | ||
fi | ||
shell: bash | ||
|
||
- name: Run Unit Tests | ||
run: | | ||
if [ "${{ runner.os }}" = "Windows" ]; then | ||
build/release/test/unittest/oasvalidator-unittests.exe | ||
else | ||
build/release/test/unittest/oasvalidator-unittests | ||
fi | ||
shell: bash | ||
|
||
- name: Run Performance Tests | ||
run: | | ||
if [ "${{ runner.os }}" = "Windows" ]; then | ||
build/release/test/perftest/oasvalidator-perftests.exe | ||
else | ||
build/release/test/perftest/oasvalidator-perftests | ||
fi | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Ubuntu Build and Test | ||
on: [push, workflow_dispatch] | ||
|
||
jobs: | ||
linux-build-and-test: | ||
uses: ./.github/workflows/common-build.yml | ||
with: | ||
os: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Mac Build and Test | ||
on: [push, workflow_dispatch] | ||
|
||
jobs: | ||
macos-build-and-test: | ||
uses: ./.github/workflows/common-build.yml | ||
with: | ||
os: macos-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- '**' | ||
#- '**' | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Windows Build and Test | ||
on: [push, workflow_dispatch] | ||
|
||
jobs: | ||
windows-build-and-test: | ||
uses: ./.github/workflows/common-build.yml | ||
with: | ||
os: windows-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"version": 6, | ||
"configurePresets": [ | ||
{ | ||
"name": "debug", | ||
"displayName": "Debug configuration for code coverage and docs", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/${presetName}", | ||
"cacheVariables": { | ||
"BUILD_COVERAGE": "ON", | ||
"BUILD_DOCS": "ON", | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "release", | ||
"displayName": "Release configuration for oasvalidator, tests and example", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/${presetName}", | ||
"cacheVariables": { | ||
"BUILD_SHARED_LIB": "OFF", | ||
"BUILD_TESTS": "ON", | ||
"BUILD_PERF": "ON", | ||
"BUILD_EXAMPLE": "ON", | ||
"CMAKE_BUILD_TYPE": "Release" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "oasvalidator-build", | ||
"displayName": "Build oasvalidator Release", | ||
"configurePreset": "release", | ||
"targets": [ | ||
"oasvalidator" | ||
] | ||
}, | ||
{ | ||
"name": "tests-build", | ||
"displayName": "Build oasvalidator tests Release", | ||
"configurePreset": "release", | ||
"targets": [ | ||
"oasvalidator-unittests", | ||
"oasvalidator-perftests" | ||
] | ||
}, | ||
{ | ||
"name": "example-build", | ||
"displayName": "Build oasvalidator example", | ||
"configurePreset": "release", | ||
"targets": [ | ||
"oasvalidator-example" | ||
] | ||
}, | ||
{ | ||
"name": "docs-build", | ||
"displayName": "Build oasvalidator docs", | ||
"configurePreset": "debug", | ||
"targets": [ | ||
"docs" | ||
] | ||
}, | ||
{ | ||
"name": "codecov-build", | ||
"displayName": "Build oasvalidator codecov", | ||
"configurePreset": "debug", | ||
"targets": [ | ||
"covhtml-oasvalidator" | ||
] | ||
} | ||
], | ||
"testPresets": [ | ||
{ | ||
"name": "test-oasvalidator", | ||
"displayName": "Test oasvalidator", | ||
"configurePreset": "release", | ||
"output": { | ||
"shortProgress": true, | ||
"verbosity": "extra" | ||
}, | ||
"execution": { | ||
"noTestsAction": "error", | ||
"testMode": "exclusive" | ||
} | ||
} | ||
], | ||
"workflowPresets": [ | ||
{ | ||
"name": "build-docs-and-codecov", | ||
"displayName": "Build oasvalidator, docs and code coverage in Debug mode", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "debug" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "docs-build" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "codecov-build" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "build-test-and-example", | ||
"displayName": "Build oasvalidator, unittest, perftests and example in Release mode", | ||
"steps": [ | ||
{ | ||
"type": "configure", | ||
"name": "release" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "oasvalidator-build" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "example-build" | ||
}, | ||
{ | ||
"type": "build", | ||
"name": "tests-build" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
@startuml | ||
skinparam linetype ortho | ||
skinparam backgroundColor transparent | ||
|
||
|
||
' Classes | ||
class ArrayDeserializer { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
Class Diagram | ||
-------------------- | ||
|
||
.. uml:: classdiagram.puml | ||
.. plantuml:: classdiagram.puml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) | ||
|
||
# Project description | ||
project(oasvalidator-example LANGUAGES CXX) | ||
project(${OASVALIDATOR}-example LANGUAGES CXX) | ||
|
||
include_directories(${OAS_INCLUDE_DIR}) | ||
|
||
# Create the executable | ||
add_executable(example example.cpp) | ||
add_executable(${PROJECT_NAME} example.cpp) | ||
|
||
# Link the executable with the library | ||
target_link_libraries(example oasvalidator) | ||
target_link_libraries(${PROJECT_NAME} oasvalidator) | ||
|
||
set(SPEC_FILE_ABSOLUTE_PATH "${CMAKE_SOURCE_DIR}/data/openAPI_example.json") | ||
add_definitions(-DSPEC_PATH="${SPEC_FILE_ABSOLUTE_PATH}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.