16
16
- cron : ' 00 12 * * 0' # every Sunday at 12:00 UTC
17
17
18
18
concurrency :
19
- group : ${{ github.workflow }}-${{ github.ref }}
19
+ group : " ${{ github.workflow }}-${{ github.ref }}"
20
20
cancel-in-progress : true
21
21
22
22
jobs :
@@ -57,10 +57,27 @@ jobs:
57
57
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`)
58
58
key = remap_languages[key.toLowerCase()]
59
59
}
60
- if (supported_languages.includes(key.toLowerCase()) &&
61
- !matrix['include'].includes({"language": key.toLowerCase()})) {
60
+ if (supported_languages.includes(key.toLowerCase())) {
62
61
console.log(`Found supported language: ${key}`)
63
- matrix['include'].push({"language": key.toLowerCase()})
62
+ let osList = ['ubuntu-latest'];
63
+ if (key.toLowerCase() === 'swift') {
64
+ osList = ['macos-latest'];
65
+ } else if (key.toLowerCase() === 'cpp') {
66
+ // TODO: update macos to latest after the below issue is resolved
67
+ // https://github.com/github/codeql-action/issues/2266
68
+ osList = ['macos-13', 'ubuntu-latest', 'windows-latest'];
69
+ }
70
+ for (let os of osList) {
71
+ // set name for matrix
72
+ if (osList.length == 1) {
73
+ name = key.toLowerCase()
74
+ } else {
75
+ name = `${key.toLowerCase()}, ${os}`
76
+ }
77
+
78
+ // add to matrix
79
+ matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name})
80
+ }
64
81
}
65
82
}
66
83
@@ -84,10 +101,15 @@ jobs:
84
101
}
85
102
86
103
analyze :
87
- name : Analyze
104
+ name : Analyze (${{ matrix.name }})
88
105
if : ${{ needs.languages.outputs.continue == 'true' }}
106
+ defaults :
107
+ run :
108
+ shell : ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
109
+ env :
110
+ GITHUB_CODEQL_BUILD : true
89
111
needs : [languages]
90
- runs-on : ${{ ( matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
112
+ runs-on : ${{ matrix.os || 'ubuntu-latest' }}
91
113
timeout-minutes : ${{ (matrix.language == 'swift' && 120) || 360 }}
92
114
permissions :
93
115
actions : read
@@ -100,9 +122,12 @@ jobs:
100
122
101
123
steps :
102
124
- name : Maximize build space
103
- uses : easimon/maximize-build-space@v8
125
+ if : >-
126
+ runner.os == 'Linux' &&
127
+ matrix.language == 'cpp'
128
+ uses : easimon/maximize-build-space@v10
104
129
with :
105
- root-reserve-mb : 20480
130
+ root-reserve-mb : 30720
106
131
remove-dotnet : ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
107
132
remove-android : ' true'
108
133
remove-haskell : ' true'
@@ -114,6 +139,12 @@ jobs:
114
139
with :
115
140
submodules : recursive
116
141
142
+ - name : Setup msys2
143
+ if : runner.os == 'Windows'
144
+ uses : msys2/setup-msys2@v2
145
+ with :
146
+ update : true
147
+
117
148
# Initializes the CodeQL tools for scanning.
118
149
- name : Initialize CodeQL
119
150
uses : github/codeql-action/init@v3
@@ -129,16 +160,20 @@ jobs:
129
160
130
161
# Pre autobuild
131
162
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
163
+ # create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository
132
164
- name : Prebuild
165
+ id : prebuild
133
166
run : |
134
- # check if .qodeql-prebuild-${{ matrix.language }}.sh exists
135
- if [ -f "./.codeql-prebuild-${{ matrix.language }}.sh" ]; then
136
- echo "Running .codeql-prebuild-${{ matrix.language }}.sh"
137
- ./.codeql-prebuild-${{ matrix.language }}.sh
167
+ # check if prebuild script exists
168
+ filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh"
169
+ if [ -f "./${filename}" ]; then
170
+ echo "Running prebuild script: ${filename}"
171
+ ./${filename}
138
172
fi
139
173
140
174
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
141
175
- name : Autobuild
176
+ if : steps.prebuild.outputs.skip_autobuild != 'true'
142
177
uses : github/codeql-action/autobuild@v3
143
178
144
179
- name : Perform CodeQL Analysis
0 commit comments