-
-
Notifications
You must be signed in to change notification settings - Fork 111
101 lines (90 loc) · 3.71 KB
/
codechecker-analysis.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
95
96
97
98
99
100
101
name: CodeChecker C++ Static Analysis
on:
push:
paths:
- 'CMakeLists.txt'
- '*.cmake'
- '*.cpp'
- '*.cc'
- '*.c'
- '*.h'
- '*.hh'
- '*.hpp'
branches:
- master
- 'codechecker*'
- 'testing' # for public testing
# Note: Keep this in sync with relase.yml!
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches:
- master
# Attempt to cancel any in-progress jobs for a given PR.
concurrency:
group: codechecker-${{ github.ref }}
cancel-in-progress: true
jobs:
ubuntu:
name: "Ubuntu Linux"
runs-on: ubuntu-latest
steps:
- name: "Check out repository"
uses: actions/checkout@v3
- name: "update APT database"
run: sudo apt -q update
- name: Installing xmllint for ci-set-vars
run: sudo apt -qy install libxml2-utils
- name: "Set variables for Contour build-like CI"
id: set_vars
run: ./scripts/ci-set-vars.sh
env:
REPOSITORY: "${{ github.event.repository.name }}"
- name: "Install build dependencies"
# Note: Keep this in sync with that in build.yml!
run: sudo env QTVER="5" SYSDEP_ASSUME_YES="ON" ./scripts/install-deps.sh
- name: "Post-fix embedded dependency permissions."
run: sudo find _deps/sources -exec chown $UID {} \;
- name: "Prepare building Contour"
# Note: Keep this in sync with that in build.yml!
run: |
BUILD_DIR="Build" \
CMAKE_BUILD_TYPE="Debug" \
EXTRA_CMAKE_FLAGS="-DCONTOUR_QT_VERSION=5" \
CXX="g++-11" \
./scripts/ci-prepare-contour.sh
- name: "Execute Static Analysis"
uses: whisperity/codechecker-analysis-action@v1
id: codechecker
continue-on-error: true
with:
llvm-version: 'latest'
config: .github/codechecker/config.json
build-command: "cd Build && cmake --build . -- -j3"
ctu: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
# Don't do differential check for now.
# diff: false
# diff-url: ${{ secrets.CODECHECKER_URL }}
# diff-username: ${{ secrets.CODECHECKER_USERNAME }}
# diff-password: ${{ secrets.CODECHECKER_PASSWORD }}
# Only upload the results as a CI artefact later, not to the server.
# store: false
# store-url: ${{ secrets.CODECHECKER_URL }}
# store-username: ${{ secrets.CODECHECKER_USERNAME }}
# store-password: ${{ secrets.CODECHECKER_PASSWORD }}
- name: "Upload HTML reports"
uses: actions/upload-artifact@v4
with:
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-codechecker-${{ steps.codechecker.outputs.codechecker-version }}+${{ steps.codechecker.outputs.codechecker-hash }}-llvm-${{ steps.codechecker.outputs.llvm-version }}-results"
path: "${{ steps.codechecker.outputs.result-html-dir }}"
if-no-files-found: error
- name: "Upload analysis failure reproducers"
uses: actions/upload-artifact@v4
with:
name: "contour-${{ steps.set_vars.outputs.VERSION_STRING }}-codechecker-${{ steps.codechecker.outputs.codechecker-version }}+${{ steps.codechecker.outputs.codechecker-hash }}-llvm-${{ steps.codechecker.outputs.llvm-version }}-failure-zips"
path: "${{ steps.codechecker.outputs.analyze-output }}/failed"
if-no-files-found: ignore
- name: "Finish job"
run: |
echo "::notice title=Static analysis job set to always pass::The job is configured in a way that it always passes. Please see the reports in the generated and uploaded artefacts."
exit 0