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