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

Coverity CI changes: remove internal workflow and add 'covscan' label workflow for PRs #7698

Closed
Closed
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
58 changes: 2 additions & 56 deletions .github/workflows/analyze-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,66 +29,12 @@ jobs:
enable_checks: "warning,unusedFunction,missingInclude"
comment_result: false

covscan:
runs-on: covscan
permissions:
contents: read
timeout-minutes: 1440
steps:
- name: Checkout target branch
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
path: target

- name: Checkout pull request branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: pr

- name: Build source rpm - ${{ github.base_ref }}
id: target
uses: ./target/.github/actions/build-sssd-srpm
with:
working-directory: target
version: ${{ github.base_ref }}

- name: Build source rpm - pr${{ github.event.pull_request.number }}
id: pr
uses: ./target/.github/actions/build-sssd-srpm
with:
working-directory: pr
version: pr${{ github.event.pull_request.number }}

- name: Run covscan
run: |
run-covscan --base-srpm "${{ steps.target.outputs.path }}" --srpm "${{ steps.pr.outputs.path }}" --output-dir logs

- name: Print result
uses: next-actions/print-logs@master
if: always()
with:
working-directory: logs
files: |
added.err
*.err

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
name: covscan
path: |
./logs/*.err

result:
name: All tests are successful
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [cppcheck, covscan]
needs: [cppcheck]
steps:
- name: Fail on failure
if: ${{ needs.cppcheck.result != 'success' || needs.covscan.result != 'success' }}
if: ${{ needs.cppcheck.result != 'success' }}
run: exit 1
13 changes: 12 additions & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
name: Coverity scan
on:
# run once daily at 00:30 UTC due to
# coverity_daily job runs once daily at 00:30 UTC due to
# https://scan.coverity.com/faq#frequency
schedule:
- cron: "30 0 * * *"
# coverity_label job triggers if PR has 'coverity' label set.
# This job likely cannot be re-run on the same day or we will
# hit the build submission limit (see above link)
pull_request_target:
branches:
- master
types:
- labeled
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
coverity:
if: |
${{ github.event_name == 'schedule' }} ||
${{ github.event.label.name == 'coverity' && github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
Loading