Skip to content

Commit ae3b67d

Browse files
authoredApr 21, 2024··
chore: update global workflows (#262)
1 parent 120012c commit ae3b67d

File tree

2 files changed

+43
-12
lines changed

2 files changed

+43
-12
lines changed
 

Diff for: ‎.github/workflows/automerge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Autoapproving
29-
uses: hmarr/auto-approve-action@v3
29+
uses: hmarr/auto-approve-action@v4
3030
with:
3131
github-token: "${{ secrets.GITHUB_TOKEN }}"
3232

@@ -49,7 +49,7 @@ jobs:
4949

5050
steps:
5151
- name: Automerging
52-
uses: pascalgn/automerge-action@v0.15.6
52+
uses: pascalgn/automerge-action@v0.16.3
5353
env:
5454
BASE_BRANCHES: nightly
5555
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}

Diff for: ‎.github/workflows/codeql.yml

+41-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
1717

1818
concurrency:
19-
group: ${{ github.workflow }}-${{ github.ref }}
19+
group: "${{ github.workflow }}-${{ github.ref }}"
2020
cancel-in-progress: true
2121

2222
jobs:
@@ -57,10 +57,25 @@ jobs:
5757
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`)
5858
key = remap_languages[key.toLowerCase()]
5959
}
60-
if (supported_languages.includes(key.toLowerCase()) &&
61-
!matrix['include'].includes({"language": key.toLowerCase()})) {
60+
if (supported_languages.includes(key.toLowerCase())) {
6261
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+
osList = ['macos-latest', 'ubuntu-latest', 'windows-latest'];
67+
}
68+
for (let os of osList) {
69+
// set name for matrix
70+
if (osList.length == 1) {
71+
name = key.toLowerCase()
72+
} else {
73+
name = `${key.toLowerCase()}, ${os}`
74+
}
75+
76+
// add to matrix
77+
matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name})
78+
}
6479
}
6580
}
6681
@@ -84,10 +99,15 @@ jobs:
8499
}
85100
86101
analyze:
87-
name: Analyze
102+
name: Analyze (${{ matrix.name }})
88103
if: ${{ needs.languages.outputs.continue == 'true' }}
104+
defaults:
105+
run:
106+
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
107+
env:
108+
GITHUB_CODEQL_BUILD: true
89109
needs: [languages]
90-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
110+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
91111
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
92112
permissions:
93113
actions: read
@@ -100,6 +120,7 @@ jobs:
100120

101121
steps:
102122
- name: Maximize build space
123+
if: runner.os == 'Linux'
103124
uses: easimon/maximize-build-space@v8
104125
with:
105126
root-reserve-mb: 20480
@@ -114,6 +135,12 @@ jobs:
114135
with:
115136
submodules: recursive
116137

138+
- name: Setup msys2
139+
if: runner.os == 'Windows'
140+
uses: msys2/setup-msys2@v2
141+
with:
142+
update: true
143+
117144
# Initializes the CodeQL tools for scanning.
118145
- name: Initialize CodeQL
119146
uses: github/codeql-action/init@v3
@@ -129,16 +156,20 @@ jobs:
129156

130157
# Pre autobuild
131158
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
159+
# create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository
132160
- name: Prebuild
161+
id: prebuild
133162
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
163+
# check if prebuild script exists
164+
filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh"
165+
if [ -f "./${filename}" ]; then
166+
echo "Running prebuild script: ${filename}"
167+
./${filename}
138168
fi
139169
140170
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
141171
- name: Autobuild
172+
if: steps.prebuild.outputs.skip_autobuild != 'true'
142173
uses: github/codeql-action/autobuild@v3
143174

144175
- name: Perform CodeQL Analysis

0 commit comments

Comments
 (0)
Please sign in to comment.