-
Notifications
You must be signed in to change notification settings - Fork 23
30 lines (27 loc) · 997 Bytes
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: PR Checks
on:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, push, ready_for_review]
workflow_dispatch:
jobs:
pr-checks:
name: Check lint
runs-on: windows-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout git repository
uses: actions/checkout@v3
- name: Check lint
run: |
New-Item src/vendor/opt/bin -Type Directory -Force
Invoke-WebRequest -Uri https://raw.githubusercontent.com/ko4life-net/ko-vendor/master/opt/bin/clang-format.exe -OutFile src/vendor/opt/bin/clang-format.exe
& .\format.ps1
$git_diff = (git diff --stat -- "*.cpp" "*.CPP" "*.c" "*.C" "*.h" "*.H")
if ($git_diff -ne $null) {
Write-Host "Code formatting issues found! Please run the format.ps1 script, commit the changes and push."
git diff --stat -- "*.cpp" "*.CPP" "*.c" "*.C" "*.h" "*.H"
exit(1)
}