Skip to content

Commit

Permalink
Split cpp workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian Eikenberg authored and rageagainsthepc committed Jul 19, 2023
1 parent ffc88c1 commit ada5e6c
Show file tree
Hide file tree
Showing 9 changed files with 374 additions and 240 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/cpp-apitracing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: CPP CI ApiTracing

on:
push:
branches:
- "main"
paths:
- 'plugins/apitracing/**.h'
- 'plugins/apitracing/**.cpp'
- 'plugins/apitracing/**/CMakeLists.txt'
- 'plugins/apitracing/CMakePresets.json'
- 'plugins/apitracing/.clang-tidy'
- 'plugins/apitracing/.clang-format'
- 'plugins/apitracing/sonar-project.properties'
pull_request:
branches:
- "main"
paths:
- 'plugins/apitracing/**.h'
- 'plugins/apitracing/**.cpp'
- 'plugins/apitracing/**/CMakeLists.txt'
- 'plugins/apitracing/CMakePresets.json'
- 'plugins/apitracing/.clang-tidy'
- 'plugins/apitracing/.clang-format'
- 'plugins/apitracing/sonar-project.properties'

jobs:
format:
runs-on: ubuntu-latest
container:
image: gdatacyberdefense/clang-format:16

steps:
- uses: actions/checkout@v3

- name: Perform C++ format check
run: find plugins/apitracing/ -iname *.h -o -iname *.cpp | xargs clang-format --style=file --dry-run --Werror

build_apitracing:
runs-on: ubuntu-latest
container:
image: ghcr.io/gdatasoftwareag/vmi-build
strategy:
matrix:
compiler: [ clang, gcc ]

steps:
- uses: actions/checkout@v3

- name: Build and test apitracing
run: |
cmake --preset ${{ matrix.compiler }}-debug
cmake --build --preset ${{ matrix.compiler }}-build-debug
ctest --preset ${{ matrix.compiler }}-test
working-directory: plugins/apitracing
56 changes: 56 additions & 0 deletions .github/workflows/cpp-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: CPP CI VMICore

on:
push:
branches:
- "main"
paths:
- 'vmicore/**.h'
- 'vmicore/**.cpp'
- 'vmicore/**/CMakeLists.txt'
- 'vmicore/CMakePresets.json'
- 'vmicore/.clang-tidy'
- 'vmicore/.clang-format'
- 'vmicore/sonar-project.properties'
pull_request:
branches:
- "main"
paths:
- 'vmicore/**.h'
- 'vmicore/**.cpp'
- 'vmicore/**/CMakeLists.txt'
- 'vmicore/CMakePresets.json'
- 'vmicore/.clang-tidy'
- 'vmicore/.clang-format'
- 'vmicore/sonar-project.properties'

jobs:
format:
runs-on: ubuntu-latest
container:
image: gdatacyberdefense/clang-format:16

steps:
- uses: actions/checkout@v3

- name: Perform C++ format check
run: find vmicore/ -iname *.h -o -iname *.cpp | xargs clang-format --style=file --dry-run --Werror

build_core:
runs-on: ubuntu-latest
container:
image: ghcr.io/gdatasoftwareag/vmi-build
strategy:
matrix:
compiler: [clang, gcc]

steps:
- uses: actions/checkout@v3

- name: Build and test vmicore
run: |
cmake --preset ${{ matrix.compiler }}-debug
cmake --build --preset ${{ matrix.compiler }}-build-debug
ctest --preset ${{ matrix.compiler }}-test
working-directory: vmicore
56 changes: 56 additions & 0 deletions .github/workflows/cpp-inmemory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: CPP CI InMemory

on:
push:
branches:
- "main"
paths:
- 'plugins/inmemoryscanner/**.h'
- 'plugins/inmemoryscanner/**.cpp'
- 'plugins/inmemoryscanner/**/CMakeLists.txt'
- 'plugins/inmemoryscanner/CMakePresets.json'
- 'plugins/inmemoryscanner/.clang-tidy'
- 'plugins/inmemoryscanner/.clang-format'
- 'plugins/inmemoryscanner/sonar-project.properties'
pull_request:
branches:
- "main"
paths:
- 'plugins/inmemoryscanner/**.h'
- 'plugins/inmemoryscanner/**.cpp'
- 'plugins/inmemoryscanner/**/CMakeLists.txt'
- 'plugins/inmemoryscanner/CMakePresets.json'
- 'plugins/inmemoryscanner/.clang-tidy'
- 'plugins/inmemoryscanner/.clang-format'
- 'plugins/inmemoryscanner/sonar-project.properties'

jobs:
format:
runs-on: ubuntu-latest
container:
image: gdatacyberdefense/clang-format:16

steps:
- uses: actions/checkout@v3

- name: Perform C++ format check
run: find plugins/inmemoryscanner/ -iname *.h -o -iname *.cpp | xargs clang-format --style=file --dry-run --Werror

build_inmemoryscanner:
runs-on: ubuntu-latest
container:
image: ghcr.io/gdatasoftwareag/vmi-build
strategy:
matrix:
compiler: [ clang, gcc ]

steps:
- uses: actions/checkout@v3

- name: Build and test inmemoryscanner
run: |
cmake --preset ${{ matrix.compiler }}-debug
cmake --build --preset ${{ matrix.compiler }}-build-debug
ctest --preset ${{ matrix.compiler }}-test
working-directory: plugins/inmemoryscanner
56 changes: 56 additions & 0 deletions .github/workflows/cpp-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: CPP CI Template

on:
push:
branches:
- "main"
paths:
- 'plugins/template/**.h'
- 'plugins/template/**.cpp'
- 'plugins/template/**/CMakeLists.txt'
- 'plugins/template/CMakePresets.json'
- 'plugins/template/.clang-tidy'
- 'plugins/template/.clang-format'
- 'plugins/template/sonar-project.properties'
pull_request:
branches:
- "main"
paths:
- 'plugins/template/**.h'
- 'plugins/template/**.cpp'
- 'plugins/template/**/CMakeLists.txt'
- 'plugins/template/CMakePresets.json'
- 'plugins/template/.clang-tidy'
- 'plugins/template/.clang-format'
- 'plugins/template/sonar-project.properties'

jobs:
format:
runs-on: ubuntu-latest
container:
image: gdatacyberdefense/clang-format:16

steps:
- uses: actions/checkout@v3

- name: Perform C++ format check
run: find plugins/template/ -iname *.h -o -iname *.cpp | xargs clang-format --style=file --dry-run --Werror

build_template:
runs-on: ubuntu-latest
container:
image: ghcr.io/gdatasoftwareag/vmi-build
strategy:
matrix:
compiler: [ clang, gcc ]

steps:
- uses: actions/checkout@v3

- name: Build and test template
run: |
cmake --preset ${{ matrix.compiler }}-debug
cmake --build --preset ${{ matrix.compiler }}-build-debug
ctest --preset ${{ matrix.compiler }}-test
working-directory: plugins/template
108 changes: 0 additions & 108 deletions .github/workflows/cpp.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/sonar-scanner-apitracing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Sonar Scanner ApiTracing

on:
workflow_run:
workflows: [CPP CI ApiTracing]
types:
- requested

jobs:
apitracing_sonar_scanner:
runs-on: ubuntu-latest
# Replicate build environment (path sctructure)
container:
image: ghcr.io/gdatasoftwareag/vmi-build
env:
BUILD_WRAPPER_OUT_DIR: sonar/

steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0

- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v1

- name: Build and test apitracing
run: |
cmake --preset gcc-debug -D APITRACING_TEST_COVERAGE:BOOL=ON
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build --preset gcc-build-debug
ctest --preset gcc-test
cd build-gcc-debug
gcovr -r .. --sonarqube > ../coverage.xml
working-directory: plugins/apitracing

- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner \
-D sonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} \
-D sonar.coverageReportPaths=coverage.xml \
-D sonar.scm.revision=${{ github.event.workflow_run.head_sha }} \
-D sonar.pullrequest.key=${{ github.event.workflow_run.pull_requests[0].number }} \
-D sonar.pullrequest.branch=${{ github.event.workflow_run.pull_requests[0].head.ref }} \
-D sonar.pullrequest.base=${{ github.event.workflow_run.pull_requests[0].base.ref }}
working-directory: plugins/apitracing/
Loading

0 comments on commit ada5e6c

Please sign in to comment.