-
Notifications
You must be signed in to change notification settings - Fork 247
94 lines (85 loc) · 2.6 KB
/
analyze-target.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: "Analyze (target)"
on:
pull_request_target:
branches: [master, sssd-2-7, sssd-2-8, sssd-2-9]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
cppcheck:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Perform cppcheck analysis
# v0.0.11 is the latest release but we need a later commit
uses: linuxdeepin/action-cppcheck@9ef62c4ec8cd5660952cd02c58b83fa57c16a42b
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pull_request_id: ${{ github.event.pull_request.number }}
allow_approve: false
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@v3
with:
ref: ${{ github.base_ref }}
path: target
- name: Checkout pull request branch
uses: actions/checkout@v3
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@v3
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]
steps:
- name: Fail on failure
if: ${{ needs.cppcheck.result != 'success' || needs.covscan.result != 'success' }}
run: exit 1