Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nawaz1991 committed Dec 4, 2023
1 parent dc05034 commit d5a77d6
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 23 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/common-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- name: Set EXT variable
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "EXT=.exe" >> $GITHUB_ENV
else
echo "EXT=" >> $GITHUB_ENV
fi
- name: Checkout cpp-oasvalidator
uses: actions/checkout@v4
with:
Expand All @@ -22,28 +31,13 @@ jobs:
uses: lukka/run-cmake@v10
id: runcmake
with:
workflowPreset: 'build-test-and-example'
workflowPreset: 'build-example-and-run-unittests'

- name: Run Example
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
build/release/example/oasvalidator-example.exe
else
build/release/example/oasvalidator-example
fi
run: ./build/release/example/oasvalidator-example${{ env.EXT }}

- 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
run: ./build/release/test/unittest/oasvalidator-unittests${{ env.EXT }}

- 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
# - name: Run Performance Tests
# run: ./build/release/test/perftest/oasvalidator-perftests${{ env.EXT }}
79 changes: 79 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Deploy docs and code coverage
on: [push, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout cpp-oasvalidator
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: 'Set up latest Oracle JDK 21'
uses: oracle-actions/setup-java@v1
with:
website: oracle.com
release: 21

# - name: Install plantuml
# run: sudo bash -c "curl -L https://raw.githubusercontent.com/riboseinc/plantuml-install/master/ubuntu.sh | bash"

- name: Install dependencies
run: |
apt-get install doxygen graphviz plantuml -y
- name: Install python dependencies
run: |
pip3 install gcovr sphinx breathe exhale furo sphinxcontrib-plantuml
- uses: lukka/get-cmake@latest

- name: Configure code coverage code coverage and docs
uses: lukka/run-cmake@v10
with:
configurePreset: 'debug'

# - name: Build performance tests in release mode
# uses: lukka/run-cmake@v10
# with:
# buildPreset: 'perftests-build'
#
# - name: Run performance tests
# run: build/release/test/perftest/oasvalidator-perftests --benchmark_format=json > build/debug/docs/benchmark.json
#
# - name: Convert benchmark.json to benchmark.rst
# run: python .github/workflows/convert_json_to_rst.py build/debug/docs/benchmark.json build/debug/docs/benchmark.rst

- name: Build docs and code coverage
uses: lukka/run-cmake@v10
with:
workflowPreset: 'build-docs-and-codecov'

- name: Copy code coverage to docs
run: cp -r build/debug/covhtml-oasvalidator build/debug/docs/html

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.MY_PAT }}
publish_dir: build/debug/docs/html

- name: Generate Coverage Report
#if: github.ref == 'refs/heads/main'
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18 changes: 15 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
"oasvalidator-perftests"
]
},
{
"name": "perftests-build",
"displayName": "Build oasvalidator tests Release",
"configurePreset": "release",
"targets": [
"oasvalidator-perftests"
]
},
{
"name": "example-build",
"displayName": "Build oasvalidator example",
Expand Down Expand Up @@ -71,7 +79,7 @@
],
"testPresets": [
{
"name": "test-oasvalidator",
"name": "run-oasvalidator-unittests",
"displayName": "Test oasvalidator",
"configurePreset": "release",
"output": {
Expand Down Expand Up @@ -104,8 +112,8 @@
]
},
{
"name": "build-test-and-example",
"displayName": "Build oasvalidator, unittest, perftests and example in Release mode",
"name": "build-example-and-run-unittests",
"displayName": "Build oasvalidator, unittest, perftests and example in Release mode and run unittests",
"steps": [
{
"type": "configure",
Expand All @@ -122,6 +130,10 @@
{
"type": "build",
"name": "tests-build"
},
{
"type": "test",
"name": "run-oasvalidator-unittests"
}
]
}
Expand Down

0 comments on commit d5a77d6

Please sign in to comment.