Skip to content

Commit 5fb15b5

Browse files
committed
chore: use ubuntu to lint code style
1 parent 59e3325 commit 5fb15b5

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

.github/workflows/commit-ci.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,17 @@ on:
1111

1212
jobs:
1313
lint:
14-
runs-on: windows-latest
14+
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout last commit
1717
uses: actions/checkout@v4
18-
- name: Install clang-format@18
19-
shell: pwsh
18+
19+
- name: Install clang-format-19
2020
run: |
21-
$version = ""
22-
if (Get-Command "clang-format" -ErrorAction SilentlyContinue){
23-
$version = clang-format --version
24-
$pat = ".*\s+(\d+\.\d+\.\d+)"
25-
if ($version -match $pat) {
26-
$version = $matches[1]
27-
}
28-
}
29-
if ($version -ne "") {
30-
Write-Host "clang-format version:$version"
31-
if ([version]$version -eq [version]"18.1.8") {
32-
Write-Host "clang-format OK"
33-
} else {
34-
Write-Host "clang-format version does not meet"
35-
choco install llvm --version=18.1.8 --force
36-
}
37-
} else {
38-
Write-Host "clang-format not installed"
39-
choco install llvm --version=18.1.8
40-
}
21+
sudo apt update
22+
sudo apt -y install clang-format-19
23+
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-19 100
24+
4125
- name: Code style lint
4226
run: make clang-format-lint
4327

0 commit comments

Comments
 (0)