Merge all code scanning (CI) files
This commit is contained in:
parent
639fe1170b
commit
b81c9894ac
3 changed files with 93 additions and 105 deletions
53
.github/workflows/clang-analysis.yml
vendored
53
.github/workflows/clang-analysis.yml
vendored
|
|
@ -1,53 +0,0 @@
|
|||
name: "Code analysis (clang)"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'dev'
|
||||
- 'stable'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'dev'
|
||||
- 'release-*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install clang-tools-11
|
||||
run: |
|
||||
sudo apt --assume-yes install wget
|
||||
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
||||
sudo apt --assume-yes install clang-tools-11
|
||||
|
||||
- name: Install meson and ninja
|
||||
run: |
|
||||
sudo apt --assume-yes install python3-wheel python3-setuptools
|
||||
pip3 install --user meson ninja
|
||||
|
||||
- name: Install microsoft/sarif-multitool
|
||||
run: |
|
||||
npm install @microsoft/sarif-multitool
|
||||
sudo apt --assume-yes install npm
|
||||
|
||||
- name: Analysis
|
||||
run: |
|
||||
export PATH=${HOME}/Library/Python/3.8/bin:${HOME}/Library/Python/3.9/bin:${HOME}/.local/bin:${PATH}
|
||||
scan-build-11 -v -sarif -o reports "meson build && meson compile -C build"
|
||||
|
||||
- name: Merge all files
|
||||
run: npx @microsoft/sarif-multitool merge reports/**/*.sarif
|
||||
|
||||
- name: Exclude external lib
|
||||
run: |
|
||||
jq 'del(.runs[].results[].locations[] | select(.physicalLocation.artifactLocation.uri | contains("subprojects/")))' merged.sarif > tmp0.sarif
|
||||
jq 'del(.runs[].results[] | select(.locations | length == 0))' tmp0.sarif > tmp1.sarif
|
||||
jq 'del(.runs[] | select(.results | length == 0))' tmp1.sarif > final.sarif
|
||||
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: final.sarif
|
||||
93
.github/workflows/code-analysis.yml
vendored
Normal file
93
.github/workflows/code-analysis.yml
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
name: "Code scanning"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * 1'
|
||||
|
||||
jobs:
|
||||
CodeQL:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install meson and ninja
|
||||
run: |
|
||||
sudo apt --assume-yes install python3-wheel python3-setuptools
|
||||
sudo pip3 install meson ninja PyYAML
|
||||
|
||||
- name: Install microsoft/sarif-multitool
|
||||
run: |
|
||||
sudo apt --assume-yes install npm
|
||||
npm install @microsoft/sarif-multitool
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
setup-python-dependencies: false
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
with:
|
||||
output: "reports"
|
||||
upload: false
|
||||
|
||||
- name: Merge all files
|
||||
run: npx @microsoft/sarif-multitool merge reports/*.sarif
|
||||
|
||||
- name: Exclude external lib
|
||||
run: |
|
||||
jq 'del(.runs[].results[].locations[] | select(.physicalLocation.artifactLocation.uri | contains("subprojects/")))' merged.sarif > tmp0.sarif
|
||||
jq 'del(.runs[].results[] | select(.locations | length == 0))' tmp0.sarif > tmp1.sarif
|
||||
jq 'del(.runs[] | select(.results | length == 0))' tmp1.sarif > final.sarif
|
||||
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: final.sarif
|
||||
|
||||
Clang:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install meson and ninja
|
||||
run: |
|
||||
sudo apt --assume-yes install python3-wheel python3-setuptools
|
||||
sudo pip3 install meson ninja PyYAML
|
||||
|
||||
- name: Install microsoft/sarif-multitool
|
||||
run: |
|
||||
sudo apt --assume-yes install npm
|
||||
npm install @microsoft/sarif-multitool
|
||||
|
||||
- name: Install clang-tools-11
|
||||
run: |
|
||||
sudo apt --assume-yes install wget
|
||||
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
|
||||
sudo apt --assume-yes install clang-tools-11
|
||||
|
||||
- name: Analysis
|
||||
run: |
|
||||
export PATH=${HOME}/Library/Python/3.8/bin:${HOME}/Library/Python/3.9/bin:${HOME}/.local/bin:${PATH}
|
||||
scan-build-11 -v -sarif -o reports "meson build && meson compile -C build"
|
||||
|
||||
- name: Merge all files
|
||||
run: npx @microsoft/sarif-multitool merge reports/**/*.sarif
|
||||
|
||||
- name: Exclude external lib
|
||||
run: |
|
||||
jq 'del(.runs[].results[].locations[] | select(.physicalLocation.artifactLocation.uri | contains("subprojects/")))' merged.sarif > tmp0.sarif
|
||||
jq 'del(.runs[].results[] | select(.locations | length == 0))' tmp0.sarif > tmp1.sarif
|
||||
jq 'del(.runs[] | select(.results | length == 0))' tmp1.sarif > final.sarif
|
||||
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: final.sarif
|
||||
52
.github/workflows/codeql-analysis.yml
vendored
52
.github/workflows/codeql-analysis.yml
vendored
|
|
@ -1,52 +0,0 @@
|
|||
name: "Code scanning - action"
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * 1'
|
||||
|
||||
jobs:
|
||||
CodeQL-Build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install meson and ninja
|
||||
run: |
|
||||
sudo apt --assume-yes install python3-wheel python3-setuptools
|
||||
sudo pip3 install meson ninja PyYAML
|
||||
|
||||
- name: Install microsoft/sarif-multitool
|
||||
run: |
|
||||
sudo apt --assume-yes install npm
|
||||
npm install @microsoft/sarif-multitool
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
setup-python-dependencies: false
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
with:
|
||||
output: "reports"
|
||||
upload: false
|
||||
|
||||
- name: Merge all files
|
||||
run: npx @microsoft/sarif-multitool merge reports/*.sarif
|
||||
|
||||
- name: Exclude external lib
|
||||
run: |
|
||||
jq 'del(.runs[].results[].locations[] | select(.physicalLocation.artifactLocation.uri | contains("subprojects/")))' merged.sarif > tmp0.sarif
|
||||
jq 'del(.runs[].results[] | select(.locations | length == 0))' tmp0.sarif > tmp1.sarif
|
||||
jq 'del(.runs[] | select(.results | length == 0))' tmp1.sarif > final.sarif
|
||||
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: final.sarif
|
||||
Loading…
Reference in a new issue