88 - main
99 - next
1010 - " rc/**"
11-
1211 push :
1312 branches :
1413 - main
4746
4847 - name : Cache CodeQL
4948 id : cache-codeql
50- uses : actions/cache@v2.1.3
49+ uses : actions/cache@v4
5150 with :
5251 path : ${{ github.workspace }}/codeql_home
5352 key : codeql-home-${{ matrix.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library }}
@@ -69,15 +68,17 @@ jobs:
6968 - name : Determine ref for external help files
7069 id : determine-ref
7170 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 }}"
7475 else
75- echo " EXTERNAL_HELP_REF=$GITHUB_REF" >> "$GITHUB_ENV "
76+ EXTERNAL_HELP_REF="$GITHUB_REF "
7677 fi
78+ echo "EXTERNAL_HELP_REF=$EXTERNAL_HELP_REF" >> "$GITHUB_ENV"
7779 echo "Using ref $EXTERNAL_HELP_REF for external help files."
7880
7981 - name : Checkout external help files
80- continue-on-error : true
8182 id : checkout-external-help-files
8283 uses : actions/checkout@v4
8384 with :
@@ -98,15 +99,36 @@ jobs:
9899 CODEQL_HOME : ${{ github.workspace }}/codeql_home
99100 run : |
100101 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
104105
105106 cd ..
106107 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
107108
108109 - name : Upload GHAS Query Pack
109- uses : actions/upload-artifact@v3
110+ uses : actions/upload-artifact@v4
110111 with :
111112 name : code-scanning-cpp-query-pack.zip
112113 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