Skip to content

Commit 072cd92

Browse files
committed
Merge remote-tracking branch 'upstream/main' into aeisenberg/unrevert-query-filters
2 parents 44f42da + b659ce5 commit 072cd92

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4750
-246
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Checks logs, SARIF, and database bundle debug artifacts exist
2+
# when the analyze step fails.
3+
name: PR Check - Debug artifacts after failure
4+
env:
5+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- releases/v1
11+
- releases/v2
12+
pull_request:
13+
types:
14+
- opened
15+
- synchronize
16+
- reopened
17+
- ready_for_review
18+
workflow_dispatch: {}
19+
jobs:
20+
upload-artifacts:
21+
strategy:
22+
matrix:
23+
os: [ubuntu-latest, macos-latest]
24+
name: Failure Expected - Upload debug artifacts
25+
continue-on-error: true
26+
timeout-minutes: 45
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- name: Check out repository
30+
uses: actions/checkout@v3
31+
- name: Prepare test
32+
id: prepare-test
33+
uses: ./.github/prepare-test
34+
with:
35+
version: latest
36+
- uses: ./../action/init
37+
with:
38+
tools: ${{ steps.prepare-test.outputs.tools-url }}
39+
debug: true
40+
debug-artifact-name: my-debug-artifacts
41+
debug-database-name: my-db
42+
- name: Build code
43+
shell: bash
44+
run: ./build.sh
45+
- uses: ./../action/analyze
46+
id: analysis
47+
with:
48+
ram: 1
49+
download-and-check-artifacts:
50+
name: Download and check debug artifacts after failure in analyze
51+
needs: upload-artifacts
52+
timeout-minutes: 45
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Download all artifacts
56+
uses: actions/download-artifact@v3
57+
- name: Check expected artifacts exist
58+
shell: bash
59+
run: |
60+
OPERATING_SYSTEMS="ubuntu-latest macos-latest"
61+
LANGUAGES="cpp csharp go java javascript python"
62+
for os in $OPERATING_SYSTEMS; do
63+
pushd "./my-debug-artifacts-$os"
64+
echo "Artifacts from run on $os:"
65+
for language in $LANGUAGES; do
66+
echo "- Checking $language"
67+
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
68+
echo "Missing a partial database bundle for $language"
69+
exit 1
70+
fi
71+
if [[ ! -d "log" ]] ; then
72+
echo "Missing database initialization logs"
73+
exit 1
74+
fi
75+
if [[ ! -d "$language/log" ]] ; then
76+
echo "Missing logs for $language"
77+
exit 1
78+
fi
79+
done
80+
popd
81+
done
82+
env:
83+
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## [UNRELEASED]
44

5-
No user facing changes.
5+
- In debug mode, debug artifacts are now uploaded even if a step in the Actions workflow fails. [#1159](https://github.com/github/codeql-action/pull/1159)
66

77
## 2.1.18 - 03 Aug 2022
88

analyze/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ outputs:
7474
runs:
7575
using: "node16"
7676
main: "../lib/analyze-action.js"
77+
post: "../lib/analyze-action-post.js"

init/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ outputs:
8282
runs:
8383
using: 'node16'
8484
main: '../lib/init-action.js'
85+
post: '../lib/init-action-post.js'

lib/actions-util.js

Lines changed: 29 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.test.js

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post-helper.js

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post-helper.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post-helper.test.js

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post-helper.test.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post.js

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action-post.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)