@@ -3,18 +3,20 @@ name: Check framework coverage changes
3
3
on :
4
4
pull_request :
5
5
paths :
6
- - ' .github/workflows/csv-coverage-pr-comment.yml'
7
- - ' */ql/src/**/*.ql'
8
- - ' */ql/src/**/*.qll'
9
- - ' */ql/lib/**/*.ql'
10
- - ' */ql/lib/**/*.qll'
11
- - ' misc/scripts/library-coverage/*.py'
6
+ - " .github/workflows/csv-coverage-pr-comment.yml"
7
+ - " .github/workflows/csv-coverage-pr-artifacts.yml"
8
+ - " .github/actions/fetch-codeql"
9
+ - " */ql/src/**/*.ql"
10
+ - " */ql/src/**/*.qll"
11
+ - " */ql/lib/**/*.ql"
12
+ - " */ql/lib/**/*.qll"
13
+ - " misc/scripts/library-coverage/*.py"
12
14
# input data files
13
- - ' */documentation/library-coverage/cwe-sink.csv'
14
- - ' */documentation/library-coverage/frameworks.csv'
15
+ - " */documentation/library-coverage/cwe-sink.csv"
16
+ - " */documentation/library-coverage/frameworks.csv"
15
17
branches :
16
18
- main
17
- - ' rc/*'
19
+ - " rc/*"
18
20
19
21
jobs :
20
22
generate :
@@ -23,77 +25,72 @@ jobs:
23
25
runs-on : ubuntu-latest
24
26
25
27
steps :
26
- - name : Dump GitHub context
27
- env :
28
- GITHUB_CONTEXT : ${{ toJSON(github.event) }}
29
- run : echo "$GITHUB_CONTEXT"
30
- - name : Clone self (github/codeql) - MERGE
31
- uses : actions/checkout@v3
32
- with :
33
- path : merge
34
- - name : Clone self (github/codeql) - BASE
35
- uses : actions/checkout@v3
36
- with :
37
- fetch-depth : 2
38
- path : base
39
- - run : |
40
- git checkout HEAD^1
41
- git log -1 --format='%H'
42
- working-directory: base
43
- - name : Set up Python 3.8
44
- uses : actions/setup-python@v4
45
- with :
46
- python-version : 3.8
47
- - name : Download CodeQL CLI
48
- env :
49
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50
- run : |
51
- gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip"
52
- - name : Unzip CodeQL CLI
53
- run : unzip -d codeql-cli codeql-linux64.zip
54
- - name : Generate CSV files on merge commit of the PR
55
- run : |
56
- echo "Running generator on merge"
57
- PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge
58
- mkdir out_merge
59
- cp framework-coverage-*.csv out_merge/
60
- cp framework-coverage-*.rst out_merge/
61
- - name : Generate CSV files on base commit of the PR
62
- run : |
63
- echo "Running generator on base"
64
- PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base
65
- mkdir out_base
66
- cp framework-coverage-*.csv out_base/
67
- cp framework-coverage-*.rst out_base/
68
- - name : Generate diff of coverage reports
69
- run : |
70
- python base/misc/scripts/library-coverage/compare-folders.py out_base out_merge comparison.md
71
- - name : Upload CSV package list
72
- uses : actions/upload-artifact@v3
73
- with :
74
- name : csv-framework-coverage-merge
75
- path : |
76
- out_merge/framework-coverage-*.csv
77
- out_merge/framework-coverage-*.rst
78
- - name : Upload CSV package list
79
- uses : actions/upload-artifact@v3
80
- with :
81
- name : csv-framework-coverage-base
82
- path : |
83
- out_base/framework-coverage-*.csv
84
- out_base/framework-coverage-*.rst
85
- - name : Upload comparison results
86
- uses : actions/upload-artifact@v3
87
- with :
88
- name : comparison
89
- path : |
90
- comparison.md
91
- - name : Save PR number
92
- run : |
93
- mkdir -p pr
94
- echo ${{ github.event.pull_request.number }} > pr/NR
95
- - name : Upload PR number
96
- uses : actions/upload-artifact@v3
97
- with :
98
- name : pr
99
- path : pr/
28
+ - name : Dump GitHub context
29
+ env :
30
+ GITHUB_CONTEXT : ${{ toJSON(github.event) }}
31
+ run : echo "$GITHUB_CONTEXT"
32
+ - name : Clone self (github/codeql) - MERGE
33
+ uses : actions/checkout@v3
34
+ with :
35
+ path : merge
36
+ - name : Clone self (github/codeql) - BASE
37
+ uses : actions/checkout@v3
38
+ with :
39
+ fetch-depth : 2
40
+ path : base
41
+ - run : |
42
+ git checkout HEAD^1
43
+ git log -1 --format='%H'
44
+ working-directory: base
45
+ - name : Set up Python 3.8
46
+ uses : actions/setup-python@v4
47
+ with :
48
+ python-version : 3.8
49
+ - name : Download CodeQL CLI
50
+ uses : ./merge/.github/actions/fetch-codeql
51
+ - name : Generate CSV files on merge commit of the PR
52
+ run : |
53
+ echo "Running generator on merge"
54
+ PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge
55
+ mkdir out_merge
56
+ cp framework-coverage-*.csv out_merge/
57
+ cp framework-coverage-*.rst out_merge/
58
+ - name : Generate CSV files on base commit of the PR
59
+ run : |
60
+ echo "Running generator on base"
61
+ PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base
62
+ mkdir out_base
63
+ cp framework-coverage-*.csv out_base/
64
+ cp framework-coverage-*.rst out_base/
65
+ - name : Generate diff of coverage reports
66
+ run : |
67
+ python base/misc/scripts/library-coverage/compare-folders.py out_base out_merge comparison.md
68
+ - name : Upload CSV package list
69
+ uses : actions/upload-artifact@v3
70
+ with :
71
+ name : csv-framework-coverage-merge
72
+ path : |
73
+ out_merge/framework-coverage-*.csv
74
+ out_merge/framework-coverage-*.rst
75
+ - name : Upload CSV package list
76
+ uses : actions/upload-artifact@v3
77
+ with :
78
+ name : csv-framework-coverage-base
79
+ path : |
80
+ out_base/framework-coverage-*.csv
81
+ out_base/framework-coverage-*.rst
82
+ - name : Upload comparison results
83
+ uses : actions/upload-artifact@v3
84
+ with :
85
+ name : comparison
86
+ path : |
87
+ comparison.md
88
+ - name : Save PR number
89
+ run : |
90
+ mkdir -p pr
91
+ echo ${{ github.event.pull_request.number }} > pr/NR
92
+ - name : Upload PR number
93
+ uses : actions/upload-artifact@v3
94
+ with :
95
+ name : pr
96
+ path : pr/
0 commit comments