Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit 24c8dd4

Browse files
chore: update global workflows (#155)
1 parent 640b134 commit 24c8dd4

File tree

3 files changed

+80
-14
lines changed

3 files changed

+80
-14
lines changed

.github/workflows/automerge.yml

Lines changed: 2 additions & 2 deletions
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 }}

.github/workflows/codeql.yml

Lines changed: 47 additions & 12 deletions
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,27 @@ 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+
// 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+
}
6481
}
6582
}
6683
@@ -84,10 +101,15 @@ jobs:
84101
}
85102
86103
analyze:
87-
name: Analyze
104+
name: Analyze (${{ matrix.name }})
88105
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
89111
needs: [languages]
90-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
112+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
91113
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
92114
permissions:
93115
actions: read
@@ -100,9 +122,12 @@ jobs:
100122

101123
steps:
102124
- 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
104129
with:
105-
root-reserve-mb: 20480
130+
root-reserve-mb: 30720
106131
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
107132
remove-android: 'true'
108133
remove-haskell: 'true'
@@ -114,6 +139,12 @@ jobs:
114139
with:
115140
submodules: recursive
116141

142+
- name: Setup msys2
143+
if: runner.os == 'Windows'
144+
uses: msys2/setup-msys2@v2
145+
with:
146+
update: true
147+
117148
# Initializes the CodeQL tools for scanning.
118149
- name: Initialize CodeQL
119150
uses: github/codeql-action/init@v3
@@ -129,16 +160,20 @@ jobs:
129160

130161
# Pre autobuild
131162
# 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
132164
- name: Prebuild
165+
id: prebuild
133166
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}
138172
fi
139173
140174
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
141175
- name: Autobuild
176+
if: steps.prebuild.outputs.skip_autobuild != 'true'
142177
uses: github/codeql-action/autobuild@v3
143178

144179
- name: Perform CodeQL Analysis
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Update changelog on release events.
7+
8+
name: Update changelog
9+
10+
on:
11+
release:
12+
types: [created, edited, deleted]
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: "${{ github.workflow }}"
17+
cancel-in-progress: true
18+
19+
jobs:
20+
update-changelog:
21+
if: >-
22+
github.event_name == 'workflow_dispatch' ||
23+
(!github.event.release.prerelease && !github.event.release.draft)
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Update Changelog
27+
uses: LizardByte/update-changelog-action@v2024.520.183314
28+
with:
29+
changelogBranch: changelog
30+
changelogFile: CHANGELOG.md
31+
token: ${{ secrets.GH_BOT_TOKEN }}

0 commit comments

Comments
 (0)