-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub workflows: Add Coverity Scan and refactoring
- Loading branch information
1 parent
0a6528f
commit 4275f57
Showing
4 changed files
with
91 additions
and
28 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,28 @@ | ||
name: CMake Build And Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
inputs: | ||
build_type: | ||
description: 'Build type (e.g., Debug, Release)' | ||
required: true | ||
default: 'Release' | ||
|
||
jobs: | ||
prepare: | ||
uses: ./.github/workflows/build-prepare.yml | ||
with: | ||
build_type: ${{ inputs.build_type }} | ||
|
||
build: | ||
runs-on: ubuntu-24.04 | ||
needs: prepare | ||
steps: | ||
- name: Build | ||
run: cmake --build build --config ${{ inputs.build_type }} | ||
|
||
- name: Tests | ||
working-directory: ${{ github.workspace }}/build | ||
run: ctest -V --test-dir test |
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,22 @@ | ||
# This reusable workflow prepares the build environment and can be invoked by other workflows. | ||
name: CMake Build Prepare | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
build_type: | ||
type: string | ||
required: true | ||
description: 'Type of the build. Default is Release.' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
run: sudo apt install libgmock-dev libgtest-dev libyaml-cpp-dev swig -y | ||
|
||
- name: Configure | ||
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} |
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
name: Coverity Scan | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
build_type: | ||
description: 'Build type (e.g., Debug, Release)' | ||
required: true | ||
default: 'Release' | ||
|
||
jobs: | ||
prepare: | ||
uses: ./.github/workflows/build-prepare.yml | ||
with: | ||
build_type: ${{ inputs.build_type }} | ||
|
||
coverity-scan: | ||
runs-on: ubuntu-24.04 | ||
needs: prepare | ||
env: | ||
COVERITY_TOKEN: ${{ secrets.COVERITY_TOKEN }} | ||
steps: | ||
- name: Set up Coverity Scan | ||
run: | | ||
wget https://scan.coverity.com/download/linux64 --post-data "token=${COVERITY_TOKEN}&project=rpm-software-management%2Flibpkgmanifest" -O coverity_tool.tgz | ||
tar -xzvf coverity_tool.tgz | ||
- name: Build with Coverity | ||
run: | | ||
cd ${{ github.workspace }}/build | ||
../cov-analysis-*/bin/cov-build --dir cov-int make -j$(nproc) | ||
- name: Upload Coverity results | ||
run: | | ||
tar czvf cov-int.tgz cov-int | ||
curl --form token=${COVERITY_TOKEN} \ | ||
--form [email protected] \ | ||
--form [email protected] \ | ||
--form version=`git log --oneline -1 | awk '{ print $1;}'` \ | ||
--form description="libpkgmanifest - Library for working with RPM manifests" \ | ||
https://scan.coverity.com/builds?project=rpm-software-management%2Flibpkgmanifest |