diff --git a/.github/workflows/cpp-apitracing.yml b/.github/workflows/cpp-apitracing.yml new file mode 100644 index 00000000..0f585848 --- /dev/null +++ b/.github/workflows/cpp-apitracing.yml @@ -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 diff --git a/.github/workflows/cpp-core.yml b/.github/workflows/cpp-core.yml new file mode 100644 index 00000000..bfe5d619 --- /dev/null +++ b/.github/workflows/cpp-core.yml @@ -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 diff --git a/.github/workflows/cpp-inmemory.yml b/.github/workflows/cpp-inmemory.yml new file mode 100644 index 00000000..c63a65f3 --- /dev/null +++ b/.github/workflows/cpp-inmemory.yml @@ -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 diff --git a/.github/workflows/cpp-template.yml b/.github/workflows/cpp-template.yml new file mode 100644 index 00000000..2dfee2be --- /dev/null +++ b/.github/workflows/cpp-template.yml @@ -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 diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml deleted file mode 100644 index 8a5fd84f..00000000 --- a/.github/workflows/cpp.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -name: CPP CI - -on: - push: - branches: - - "main" - paths: - - '**.h' - - '**.cpp' - - '**/CMakeLists.txt' - - '**/CMakePresets.json' - - '**/.clang-tidy' - - '**/.clang-format' - pull_request: - branches: - - "main" - paths: - - '**.h' - - '**.cpp' - - '**/CMakeLists.txt' - - '**/CMakePresets.json' - - '**/.clang-tidy' - - '**/.clang-format' - -jobs: - format: - runs-on: ubuntu-latest - container: - image: gdatacyberdefense/clang-format:14 - - steps: - - uses: actions/checkout@v3 - - - name: Perform C++ format check - run: find . -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 - - 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 - - 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 - - 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 diff --git a/.github/workflows/sonar-scanner-apitracing.yml b/.github/workflows/sonar-scanner-apitracing.yml new file mode 100644 index 00000000..7da97935 --- /dev/null +++ b/.github/workflows/sonar-scanner-apitracing.yml @@ -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/ diff --git a/.github/workflows/sonar-scanner-core.yml b/.github/workflows/sonar-scanner-core.yml new file mode 100644 index 00000000..000039ca --- /dev/null +++ b/.github/workflows/sonar-scanner-core.yml @@ -0,0 +1,50 @@ +--- +name: Sonar Scanner VMICore + +on: + workflow_run: + workflows: [CPP CI VMICore] + types: + - requested + +jobs: + vmicore_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 vmicore + run: | + cmake --preset gcc-debug -D VMICORE_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: vmicore + + - 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: vmicore/ diff --git a/.github/workflows/sonar-scanner-inmemory.yml b/.github/workflows/sonar-scanner-inmemory.yml new file mode 100644 index 00000000..6297689e --- /dev/null +++ b/.github/workflows/sonar-scanner-inmemory.yml @@ -0,0 +1,50 @@ +--- +name: Sonar Scanner InMemory + +on: + workflow_run: + workflows: [CPP CI InMemory] + types: + - requested + +jobs: + inmemoryscanner_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 inmemoryscanner + run: | + cmake --preset gcc-debug -D INMEMORYSCANNER_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/inmemoryscanner + + - 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/inmemoryscanner/ diff --git a/.github/workflows/sonar-scanner.yml b/.github/workflows/sonar-scanner.yml deleted file mode 100644 index eff30211..00000000 --- a/.github/workflows/sonar-scanner.yml +++ /dev/null @@ -1,132 +0,0 @@ ---- -name: Sonar Scanner - -on: - workflow_run: - workflows: [CPP CI] - types: - - requested - -jobs: - vmicore_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 vmicore - run: | - cmake --preset gcc-debug -D VMICORE_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: vmicore - - - 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: vmicore/ - - inmemoryscanner_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 inmemoryscanner - run: | - cmake --preset gcc-debug -D INMEMORYSCANNER_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/inmemoryscanner - - - 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/inmemoryscanner/ - - 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/