Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix lint, always lint with clang-format 18.1.8 #992

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,37 @@ on:
tags:
- '![0-9]+.*'
pull_request:
workflow_dispatch:

jobs:
lint:
runs-on: macos-14
runs-on: windows-2019
steps:
- name: Checkout last commit
uses: actions/checkout@v4
- name: Install latest lang-format
run: brew update && brew install clang-format
- name: Install clang-format@18
shell: pwsh
run: |
$version = ""
if (Get-Command "clang-format" -ErrorAction SilentlyContinue){
$version = clang-format --version
$pat = ".*\s+(\d+\.\d+\.\d+)"
if ($version -match $pat) {
$version = $matches[1]
}
}
if ($version -ne "") {
Write-Host "clang-format version:$version"
if ([version]$version -eq [version]"18.1.8") {
Write-Host "clang-format OK"
} else {
Write-Host "clang-format version does not meet"
choco install llvm --version=18.1.8 --force
}
} else {
Write-Host "clang-format not installed"
choco install llvm --version=18.1.8
}
- name: Code style lint
run: make clang-format-lint

Expand Down
Loading