Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub workflows: Add Coverity Scan and refactoring #23

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
run: sudo apt install libgmock-dev libgtest-dev libyaml-cpp-dev swig -y

- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
run: cmake --build build

- name: Tests
working-directory: ${{github.workspace}}/build
working-directory: ${{ github.workspace }}/build
run: ctest -V --test-dir test
41 changes: 41 additions & 0 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Coverity Scan

on:
workflow_dispatch:

env:
BUILD_TYPE: Release
COVERITY_TOKEN: ${{ secrets.COVERITY_TOKEN }}

jobs:
coverity-scan:
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=${{ env.BUILD_TYPE }}

- name: Set up Coverity Scan
run: |
wget https://scan.coverity.com/download/linux64 --post-data "token=${{ env.COVERITY_TOKEN }}&project=rpm-software-management%2Flibpkgmanifest" -O coverity_tool.tgz
tar -xzvf coverity_tool.tgz

- name: Build with Coverity
run: |
cd 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=${{ env.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