Skip to content

Commit

Permalink
Update clang-format version and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wopss committed Dec 5, 2023
1 parent d6c00f5 commit e8c3ae2
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
LLVM_VERSION: 15
LLVM_VERSION: 17

jobs:
format:
Expand All @@ -21,27 +21,18 @@ jobs:

- name: Pin to a specific version
run: |
$latestChocoVersion = (Get-LatestChocoPackageVersion -TargetVersion $env:LLVM_VERSION -PackageName "llvm")
Choco-Install -PackageName llvm -ArgumentList '--allow-downgrade', '--version', $latestChocoVersion
$latestChocoVersion = (Resolve-ChocoPackageVersion -PackageName "llvm" -TargetVersion $env:LLVM_VERSION)
Install-ChocoPackage -PackageName llvm -ArgumentList '--allow-downgrade', '--version', $latestChocoVersion
- name: Run clang-format
env:
RED4EXT_COMMIT_BEFORE: ${{ github.event.pull_request.base.sha || github.event.before }}
RED4EXT_COMMIT_AFTER: ${{ github.sha }}
run: |
$output = (git `
-c core.autocrlf=false `
-c core.eol=lf `
-c color.ui=always `
clang-format `
--style file `
--diff $env:RED4EXT_COMMIT_BEFORE $env:RED4EXT_COMMIT_AFTER
)?.Trim()
Write-Output $output
# A temporary fix for https://github.com/llvm/llvm-project/issues/56736.
# TODO: Once LLVM 16 is released, reduce this to only the "git ... clang-format ..." command.
if ($LASTEXITCODE -eq 1 -and !$output) {
exit 0
}
run: >-
git
-c core.autocrlf=false
-c core.eol=lf
-c color.ui=always
clang-format
--style file
--diff $env:RED4EXT_COMMIT_BEFORE $env:RED4EXT_COMMIT_AFTER

0 comments on commit e8c3ae2

Please sign in to comment.