@@ -2,34 +2,37 @@ name: CodeQL Unit Testing
2
2
3
3
on :
4
4
merge_group :
5
+ types : [checks_requested]
5
6
push :
6
7
branches :
7
8
- main
8
- - " rc/**"
9
9
- next
10
+ - " rc/**"
10
11
pull_request :
11
12
branches :
12
- - " **"
13
- workflow_dispatch :
13
+ - main
14
+ - next
15
+ - " rc/**"
14
16
15
17
jobs :
18
+
16
19
prepare-unit-test-matrix :
17
20
name : Prepare CodeQL unit test matrix
18
21
runs-on : ubuntu-22.04
19
22
outputs :
20
23
matrix : ${{ steps.export-unit-test-matrix.outputs.matrix }}
21
24
steps :
22
25
- name : Checkout repository
23
- uses : actions/checkout@v2
26
+ uses : actions/checkout@v4
24
27
25
28
- name : Export unit test matrix
26
29
id : export-unit-test-matrix
27
30
run : |
28
31
echo "Merging Result:"
29
32
python scripts/create_language_matrix.py
30
- echo "::set-output name= matrix:: $(
33
+ echo "matrix= $(
31
34
python scripts/create_language_matrix.py | \
32
- jq --compact-output 'map([.+{os: "ubuntu-20.04 -xl", codeql_standard_library_ident : .codeql_standard_library | sub("\/"; "_")}]) | flatten | {include: .}')"
35
+ jq --compact-output 'map([.+{os: "ubuntu-latest -xl", codeql_standard_library_ident : .codeql_standard_library | sub("\/"; "_")}]) | flatten | {include: .}')" >> $GITHUB_OUTPUT
33
36
34
37
run-test-suites :
35
38
name : Run unit tests
@@ -39,22 +42,22 @@ jobs:
39
42
strategy :
40
43
fail-fast : false
41
44
matrix : ${{ fromJSON(needs.prepare-unit-test-matrix.outputs.matrix) }}
42
-
45
+
43
46
steps :
44
47
- name : Checkout repository
45
- uses : actions/checkout@v2
48
+ uses : actions/checkout@v4
46
49
47
50
- name : Install Python
48
51
uses : actions/setup-python@v4
49
52
with :
50
53
python-version : " 3.9"
51
-
54
+
52
55
- name : Install Python dependencies
53
56
run : pip install -r scripts/requirements.txt
54
57
55
58
- name : Cache CodeQL
56
59
id : cache-codeql
57
- uses : actions/cache@v2.1.3
60
+ uses : actions/cache@v3
58
61
with :
59
62
# A list of files, directories, and wildcard patterns to cache and restore
60
63
path : ${{github.workspace}}/codeql_home
@@ -101,7 +104,7 @@ jobs:
101
104
102
105
def print_error(fmt, *args):
103
106
print(f"::error::{fmt}", *args)
104
-
107
+
105
108
def print_error_and_fail(fmt, *args):
106
109
print_error(fmt, args)
107
110
sys.exit(1)
@@ -148,7 +151,7 @@ jobs:
148
151
file.close()
149
152
150
153
- name : Upload test results
151
- uses : actions/upload-artifact@v2
154
+ uses : actions/upload-artifact@v3
152
155
with :
153
156
name : ${{ matrix.language }}-test-results-${{ runner.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }}
154
157
path : |
@@ -157,11 +160,11 @@ jobs:
157
160
158
161
validate-test-results :
159
162
name : Validate test results
160
- needs : [ run-test-suites]
163
+ needs : run-test-suites
161
164
runs-on : ubuntu-22.04
162
165
steps :
163
166
- name : Collect test results
164
- uses : actions/download-artifact@v2
167
+ uses : actions/download-artifact@v3
165
168
166
169
- name : Validate test results
167
170
run : |
0 commit comments