Skip to content

Patch clang-tidy setup #400

Patch clang-tidy setup

Patch clang-tidy setup #400

Workflow file for this run

name: Build & Latest Beta
on:
push:
pull_request:
paths-ignore:
- '**.md'
env:
USERNAME: uvcat7
FEED_URL: https://nuget.pkg.github.com/uvcat7/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/uvcat7/index.json,readwrite"
jobs:
windows:
name: "Build Windows x64"
runs-on: windows-2022
permissions:
contents: read
steps:
- name: Get AV
uses: actions/checkout@v5
- name: Check formatting with clang-format
run: >
clang-format --dry-run --Werror -style=file $(find src/ -type f \( -name '*.cpp' -o -name '*.h' -o -name '*.c' -o -name '*.hpp' \))
shell: bash
- name: Obtain oggenc2.exe
run: >
curl https://www.rarewares.org/files/ogg/oggenc2.88-1.3.7-x64.zip --output oggenc.zip &&
unzip oggenc.zip -d bin/
shell: bash
- name: Add NuGet sources
shell: pwsh
run: |
.$(vcpkg fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GH_PACKAGES_TOKEN }}"
.$(vcpkg fetch nuget) `
setapikey "${{ secrets.GH_PACKAGES_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
- name: Configure CMake
shell: cmd
run: |
for /f "usebackq tokens=*" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set "VSPATH=%%i"
if not defined VSPATH (
echo Visual Studio not found via vswhere
exit /b 1
)
if exist "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat" (
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
) else (
call "%VSPATH%\Common7\Tools\VsDevCmd.bat" -arch=amd64
)
cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_TOOLCHAIN_FILE="%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake" ^
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md ^
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Use reviewdog
uses: reviewdog/action-setup@v1
- name: Run clang-tidy
run: |
find src/ -type f \( -name '*.cpp' -o -name '*.h' \) | xargs -P $(nproc) -n 1 -I{} sh -c 'clang-tidy -p build "{}"' > clang-tidy.log 2>&1
cat clang-tidy.log | reviewdog -efm="%f:%l:%c: %t: %m" -name="clang-tidy" -reporter=github-check -fail-on-error=true
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Build AV
run: cmake --build build --config Release --parallel "$env:NUMBER_OF_PROCESSORS"
- name: Collect into a directory
if: github.ref_name == 'beta'
run: cmake --install build --config Release --prefix ./
- name: Upload artifact
if: github.ref_name == 'beta'
uses: actions/upload-artifact@v4
with:
name: ArrowVortex-${{ github.sha }}
path: |
bin/assets
bin/noteskins
bin/settings
bin/ArrowVortex.exe
bin/oggenc2.exe
if-no-files-found: error