Skip to content

Commit f8b8d64

Browse files
authored
.sync/codeql: Attempt to upload logs in case of success and failures (#168)
Currently, log artifacts are only uploaded in case of success. This change also uploads logs in case of failures to aid in debugging. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
1 parent 7c1c1be commit f8b8d64

1 file changed

Lines changed: 45 additions & 25 deletions

File tree

.sync/workflows/leaf/codeql.yml

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,43 @@ jobs:
153153
if: steps.get_ci_file_operations.outputs.setup_supported == 'true'
154154
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }}
155155

156+
- name: Upload Setup Log As An Artifact
157+
uses: actions/upload-artifact@v3
158+
if: (success() || failure()) && steps.get_ci_file_operations.outputs.setup_supported == 'true'
159+
with:
160+
name: ${{ matrix.package }}-Logs
161+
path: |
162+
**/SETUPLOG.txt
163+
retention-days: 7
164+
if-no-files-found: ignore
165+
156166
- name: CI Setup
157167
if: steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
158168
run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }}
159169

170+
- name: Upload CI Setup Log As An Artifact
171+
uses: actions/upload-artifact@v3
172+
if: (success() || failure()) && steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
173+
with:
174+
name: ${{ matrix.package }}-Logs
175+
path: |
176+
**/CISETUP.txt
177+
retention-days: 7
178+
if-no-files-found: ignore
179+
160180
- name: Update
161181
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }}
162182

183+
- name: Upload Update Log As An Artifact
184+
uses: actions/upload-artifact@v3
185+
if: success() || failure()
186+
with:
187+
name: ${{ matrix.package }}-Logs
188+
path: |
189+
**/UPDATE_LOG.txt
190+
retention-days: 7
191+
if-no-files-found: ignore
192+
163193
- name: Find CodeQL Plugin Directory
164194
id: find_dir
165195
shell: python
@@ -240,6 +270,21 @@ jobs:
240270
STUART_CODEQL_PATH: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
241271
run: stuart_ci_build -c .pytool/CISettings.py -t DEBUG -p ${{ matrix.package }} -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }} --codeql
242272

273+
- name: Upload Build Logs As An Artifact
274+
uses: actions/upload-artifact@v3
275+
if: success() || failure()
276+
with:
277+
name: ${{ matrix.package }}-Logs
278+
path: |
279+
**/BUILD_REPORT.TXT
280+
**/OVERRIDELOG.TXT
281+
**/BUILDLOG_*.md
282+
**/BUILDLOG_*.txt
283+
**/CI_*.md
284+
**/CI_*.txt
285+
retention-days: 7
286+
if-no-files-found: ignore
287+
243288
- name: Prepare Env Data for CodeQL Upload
244289
id: env_data
245290
env:
@@ -256,31 +301,6 @@ jobs:
256301
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
257302
print(f'sarif_file_path={sarif_path}', file=fh)
258303
259-
- name: Upload Setup and Update Logs As An Artifact
260-
uses: actions/upload-artifact@v3
261-
with:
262-
name: ${{ matrix.package }}-Setup-Update-Logs
263-
path: |
264-
**/OVERRIDELOG.TXT
265-
CISETUP.txt
266-
SETUPLOG.txt
267-
UPDATE_LOG.txt
268-
retention-days: 3
269-
if-no-files-found: ignore
270-
271-
- name: Upload Build Log As An Artifact
272-
uses: actions/upload-artifact@v3
273-
with:
274-
name: ${{ matrix.package }}-Build-Logs
275-
path: |
276-
**/BUILD_REPORT.TXT
277-
BUILDLOG_*.md
278-
BUILDLOG_*.txt
279-
CI_*.md
280-
CI_*.txt
281-
retention-days: 7
282-
if-no-files-found: ignore
283-
284304
- name: Upload CodeQL Results (SARIF) As An Artifact
285305
uses: actions/upload-artifact@v3
286306
with:

0 commit comments

Comments
 (0)