mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Add option to manually trigger the workflow
This commit is contained in:
20
.github/workflows/csv-coverage.yml
vendored
20
.github/workflows/csv-coverage.yml
vendored
@@ -1,6 +1,11 @@
|
||||
name: Build CSV flow coverage report
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
qlModelShaOverride:
|
||||
description: 'github/codeql repo SHA used for looking up the CSV models'
|
||||
required: false
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
@@ -22,7 +27,18 @@ jobs:
|
||||
- name: Clone self (github/codeql)
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: codeql
|
||||
path: script
|
||||
- name: Clone self (github/codeql) at a given SHA for analysis
|
||||
if: github.event.inputs.qlModelShaOverride != ''
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: codeqlModels
|
||||
ref: github.event.inputs.qlModelShaOverride
|
||||
- name: Clone self (github/codeql) for analysis
|
||||
if: github.event.inputs.qlModelShaOverride == ''
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: codeqlModels
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
@@ -38,7 +54,7 @@ jobs:
|
||||
run: unzip -d codeql-cli codeql-linux64.zip
|
||||
- name: Build modeled package list
|
||||
run: |
|
||||
PATH="$PATH:codeql-cli/codeql" python codeql/misc/scripts/generate-csv-coverage-report.py codeql
|
||||
PATH="$PATH:codeql-cli/codeql" python script/misc/scripts/generate-csv-coverage-report.py codeqlModels script
|
||||
- name: Upload CSV package list
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
|
||||
@@ -120,14 +120,18 @@ except Exception as e:
|
||||
print("Error: couldn't invoke CodeQL CLI 'codeql'. Is it on the path? Aborting.", file=sys.stderr)
|
||||
raise e
|
||||
|
||||
prefix = ""
|
||||
query_prefix = ""
|
||||
data_prefix = ""
|
||||
if len(sys.argv) > 1:
|
||||
prefix = sys.argv[1] + "/"
|
||||
query_prefix = sys.argv[1] + "/"
|
||||
|
||||
if len(sys.argv) > 2:
|
||||
data_prefix = sys.argv[2] + "/"
|
||||
|
||||
# Languages for which we want to generate coverage reports.
|
||||
configs = [
|
||||
LanguageConfig(
|
||||
"java", "Java", ".java", prefix + "java/ql/src/meta/frameworks/Coverage.ql")
|
||||
"java", "Java", ".java", query_prefix + "java/ql/src/meta/frameworks/Coverage.ql")
|
||||
]
|
||||
|
||||
# The names of input and output files. The placeholder {language} is replaced with the language name.
|
||||
@@ -135,8 +139,8 @@ output_rst = "flow-model-coverage.rst"
|
||||
output_rst_csv = "rst-csv-flow-model-coverage-{language}.csv"
|
||||
output_ql_csv = "output-{language}.csv"
|
||||
output_csv = "csv-flow-model-coverage-{language}.csv"
|
||||
input_framework_csv = prefix + "misc/scripts/frameworks-{language}.csv"
|
||||
input_cwe_sink_csv = prefix + "misc/scripts/cwe-sink-{language}.csv"
|
||||
input_framework_csv = data_prefix + "misc/scripts/frameworks-{language}.csv"
|
||||
input_cwe_sink_csv = data_prefix + "misc/scripts/cwe-sink-{language}.csv"
|
||||
|
||||
with open(output_rst, 'w') as rst_file:
|
||||
for config in configs:
|
||||
|
||||
Reference in New Issue
Block a user