| 1 |
name: CodeChecker |
| 2 |
|
| 3 |
on: [workflow_dispatch] |
| 4 |
#on: |
| 5 |
# push: |
| 6 |
# branches: [ master ] |
| 7 |
|
| 8 |
jobs: |
| 9 |
codechecker: |
| 10 |
runs-on: ubuntu-latest |
| 11 |
|
| 12 |
steps: |
| 13 |
- uses: actions/checkout@main |
| 14 |
|
| 15 |
- name: install required packages |
| 16 |
run: sudo apt-get install libatm-dev libperl-dev libpopt-dev libsensors4-dev libssh2-1-dev libxml2-dev uuid-dev libkrb5-dev python3-setuptools |
| 17 |
|
| 18 |
- name: install clang v12 |
| 19 |
run: | |
| 20 |
wget https://apt.llvm.org/llvm.sh |
| 21 |
chmod +x llvm.sh |
| 22 |
sudo ./llvm.sh 12 |
| 23 |
sudo apt-get install clang clang-tidy |
| 24 |
|
| 25 |
- name: install packages required by CodeChecker |
| 26 |
run: | |
| 27 |
sudo apt-get install doxygen gcc-multilib python-virtualenv |
| 28 |
|
| 29 |
- name: install nodejs version 12.x |
| 30 |
run: | |
| 31 |
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - |
| 32 |
sudo apt-get install nodejs |
| 33 |
|
| 34 |
- name: install CodeChecker v6.14 |
| 35 |
run: | |
| 36 |
git clone https://github.com/Ericsson/CodeChecker.git /opt/codechecker |
| 37 |
git -C /opt/codechecker/ checkout -b b6.14.0 v6.14.0 |
| 38 |
make -C /opt/codechecker venv |
| 39 |
. /opt/codechecker/venv/bin/activate |
| 40 |
make -C /opt/codechecker package |
| 41 |
|
| 42 |
- name: CodeChecker version |
| 43 |
run: | |
| 44 |
source /opt/codechecker/venv/bin/activate |
| 45 |
export PATH=/opt/codechecker/build/CodeChecker/bin:$PATH; |
| 46 |
CodeChecker version |
| 47 |
|
| 48 |
- name: configure |
| 49 |
run: MODE=regular; ci/net-snmp-configure ${GITHUB_REF##*/} |
| 50 |
|
| 51 |
- name: Codechecker log |
| 52 |
run: | |
| 53 |
source /opt/codechecker/venv/bin/activate |
| 54 |
export PATH=/opt/codechecker/build/CodeChecker/bin:$PATH |
| 55 |
CodeChecker log -o codechecker-log.json -b "make" |
| 56 |
|
| 57 |
- name: Codechecker analyze |
| 58 |
run: | |
| 59 |
source /opt/codechecker/venv/bin/activate |
| 60 |
export PATH=/opt/codechecker/build/CodeChecker/bin:$PATH |
| 61 |
echo "-*/conftest.c" > codechecker.skipfile |
| 62 |
echo "-*/conftest.cpp" >> codechecker.skipfile |
| 63 |
echo "-*/tmp.*.c" >> codechecker.skipfile |
| 64 |
CodeChecker analyze -j $(nproc) --clean --skip codechecker.skipfile -o ./results --report-hash context-free-v2 codechecker-log.json |
| 65 |
#CodeChecker analyze -j $(nproc) --clean --skip codechecker.skipfile --ctu -e sensitive -o ./results --report-hash context-free-v2 codechecker-log.json |
| 66 |
|
| 67 |
- name: CodeChecker parse |
| 68 |
run: | |
| 69 |
source /opt/codechecker/venv/bin/activate; |
| 70 |
export PATH=/opt/codechecker/build/CodeChecker/bin:$PATH |
| 71 |
CodeChecker parse -e html ./results -o ./reports_html |
| 72 |
|
| 73 |
- name: Archive CodeChecker results |
| 74 |
uses: actions/upload-artifact@v2 |
| 75 |
with: |
| 76 |
name: CodeChecker reports |
| 77 |
path: reports_html |