8
8
- main
9
9
- next
10
10
- " rc/**"
11
-
12
11
push :
13
12
branches :
14
13
- main
47
46
48
47
- name : Cache CodeQL
49
48
id : cache-codeql
50
- uses : actions/cache@v2.1.3
49
+ uses : actions/cache@v4
51
50
with :
52
51
path : ${{ github.workspace }}/codeql_home
53
52
key : codeql-home-${{ matrix.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }}
@@ -69,15 +68,17 @@ jobs:
69
68
- name : Determine ref for external help files
70
69
id : determine-ref
71
70
run : |
72
- if [[ $GITHUB_EVENT_NAME == "pull_request" || $GITHUB_EVENT_NAME == "merge_group" ]]; then
73
- echo "EXTERNAL_HELP_REF=$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
71
+ if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
72
+ EXTERNAL_HELP_REF="${{ github.event.pull_request.base.ref }}"
73
+ elif [[ $GITHUB_EVENT_NAME == "merge_group" ]]; then
74
+ EXTERNAL_HELP_REF="${{ github.event.merge_group.base_ref }}"
74
75
else
75
- echo " EXTERNAL_HELP_REF=$GITHUB_REF" >> "$GITHUB_ENV "
76
+ EXTERNAL_HELP_REF="$GITHUB_REF "
76
77
fi
78
+ echo "EXTERNAL_HELP_REF=$EXTERNAL_HELP_REF" >> "$GITHUB_ENV"
77
79
echo "Using ref $EXTERNAL_HELP_REF for external help files."
78
80
79
81
- name : Checkout external help files
80
- continue-on-error : true
81
82
id : checkout-external-help-files
82
83
uses : actions/checkout@v4
83
84
with :
@@ -98,15 +99,36 @@ jobs:
98
99
CODEQL_HOME : ${{ github.workspace }}/codeql_home
99
100
run : |
100
101
PATH=$PATH:$CODEQL_HOME/codeql
101
-
102
- codeql query compile --precompile --threads 0 cpp
103
- codeql query compile --precompile --threads 0 c
102
+ # Precompile all queries, and use a compilation cache larger than default
103
+ # to ensure we cache all the queries for later steps
104
+ codeql query compile --precompile --threads 0 --compilation-cache-size=1024 cpp c
104
105
105
106
cd ..
106
107
zip -r codeql-coding-standards/code-scanning-cpp-query-pack.zip codeql-coding-standards/c/ codeql-coding-standards/cpp/ codeql-coding-standards/.codeqlmanifest.json codeql-coding-standards/supported_codeql_configs.json codeql-coding-standards/scripts/configuration codeql-coding-standards/scripts/reports codeql-coding-standards/scripts/shared codeql-coding-standards/scripts/guideline_recategorization codeql-coding-standards/schemas
107
108
108
109
- name : Upload GHAS Query Pack
109
- uses : actions/upload-artifact@v3
110
+ uses : actions/upload-artifact@v4
110
111
with :
111
112
name : code-scanning-cpp-query-pack.zip
112
113
path : code-scanning-cpp-query-pack.zip
114
+
115
+ - name : Create qlpack bundles
116
+ env :
117
+ CODEQL_HOME : ${{ github.workspace }}/codeql_home
118
+ run : |
119
+ PATH=$PATH:$CODEQL_HOME/codeql
120
+
121
+ codeql pack bundle --output=common-cpp-coding-standards.tgz cpp/common/src
122
+ codeql pack bundle --output=common-c-coding-standards.tgz c/common/src
123
+ codeql pack bundle --output=misra-c-coding-standards.tgz c/misra/src
124
+ codeql pack bundle --output=cert-c-coding-standards.tgz c/cert/src
125
+ codeql pack bundle --output=cert-cpp-coding-standards.tgz cpp/cert/src
126
+ codeql pack bundle --output=autosar-cpp-coding-standards.tgz cpp/autosar/src
127
+ codeql pack bundle --output=misra-cpp-coding-standards.tgz cpp/misra/src
128
+ codeql pack bundle --output=report-coding-standards.tgz cpp/report/src
129
+
130
+ - name : Upload qlpack bundles
131
+ uses : actions/upload-artifact@v4
132
+ with :
133
+ name : coding-standards-codeql-packs
134
+ path : ' *-coding-standards.tgz'
0 commit comments