Skip to content

Commit

Permalink
ci: manual clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Jan 29, 2024
1 parent 26fa696 commit 00ca5d8
Showing 1 changed file with 34 additions and 22 deletions.
56 changes: 34 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:

- uses: xmake-io/github-action-setup-xmake@v1

# - uses: actions/cache@v4
# with:
# path: |
# ~/AppData/Local/.xmake
# key: xmake-${{ hashFiles('xmake.lua') }}
# restore-keys: |
# xmake-
- uses: actions/cache@v4
with:
path: |
~/AppData/Local/.xmake
key: xmake-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-
- run: |
xmake repo -u
Expand All @@ -41,7 +41,20 @@ jobs:
path: |
bin/
check-code:
clang-format:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- run: |
choco install llvm -y --version=17.0.6
- name: clang-format
run: |
Get-ChildItem src/ -Filter *.cpp -Recurse | ForEach-Object { clang-format -i -Werror $_.FullName }
Get-ChildItem src/ -Filter *.h -Recurse | ForEach-Object { clang-format -i -Werror $_.FullName }
clang-tidy:
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -55,25 +68,24 @@ jobs:

- uses: xmake-io/github-action-setup-xmake@v1

- uses: actions/cache@v4
with:
path: |
~/AppData/Local/.xmake
key: xmake-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-
- run: |
xmake repo -u
- run: |
xmake f -a x64 -m release -p windows -v -y --backend=${{ matrix.backend }}
- run: |
xmake project -k compile_commands
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: cpp-linter-action
uses: cpp-linter/cpp-linter-action@v2
with:
files-changed-only: false
style: file
tidy-checks: ''
version: 17

- if: ${{ steps.cpp-linter-action.outputs.checks-failed > 0 }}
choco install llvm -y --version=17.0.6
- name: clang-tidy
run: |
exit 1
Get-ChildItem src/ -Filter *.cpp -Recurse | ForEach-Object { clang-tidy $_.FullName }
Get-ChildItem src/ -Filter *.h -Recurse | ForEach-Object { clang-tidy $_.FullName }

0 comments on commit 00ca5d8

Please sign in to comment.