Merge pull request #282 from MiranDMC/master #80
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Plugin GTA 3 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - "!**.dll" | |
| - "!**.md" | |
| - "!**.txt" | |
| - "tools/premake/**" | |
| - "hooking/**" | |
| - "injector/**" | |
| - "modutils/**" | |
| - "safetyhook/**" | |
| - "shared/**" | |
| - "plugin_III/**" | |
| pull_request: | |
| paths: | |
| - "!**.dll" | |
| - "!**.md" | |
| - "!**.txt" | |
| - "tools/premake/**" | |
| - "hooking/**" | |
| - "injector/**" | |
| - "modutils/**" | |
| - "safetyhook/**" | |
| - "shared/**" | |
| - "plugin_III/**" | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: Setup msbuild | |
| uses: microsoft/setup-msbuild@v2 # add msbuild to PATH | |
| - name: Premake Visual Studio project | |
| shell: cmd | |
| run: | | |
| set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE% | |
| "tools\generate\Visual Studio.bat" | |
| - name: Build | |
| shell: cmd | |
| run: | | |
| rem Compile SDK and test plugin projects | |
| echo off | |
| set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE% | |
| echo ::group::Build SDK | |
| msbuild plugin.sln /property:Configuration=zDebug /property:Platform="Mixed Platforms" /target:plugin_iii /m /fileLogger1 /fileLoggerParameters1:warningsOnly;errorsOnly;logfile=output.log | |
| powershell -Command "(gc output.log) | sort | get-unique > output.log" | |
| powershell -Command "(gc output.log) -replace ' \d>','' -replace '.:\\a\\plugin-sdk\\plugin-sdk\\','' | Out-File -encoding ASCII output.log" | |
| powershell -Command "foreach($line in Get-Content 'output.log') { $m = $line -match '^(.*)\((\d+),(\d+)\): (\w+) (.*) \[.*\]$'; if ($m) {$m = $Matches; echo ('::'+$m[4]+' file='+$m[1]+',line='+$m[2]+',title=SDK compilation::'+$m[5])} else {echo ('::error title=SDK compilation::' + $line)} }" | |
| for %%R in (output.log) do if not %%~zR lss 1 (exit 1) | |
| echo ::groupEnd:: | |
| echo ::group::Build test plugin | |
| msbuild examples\Test\Test.sln /property:Configuration=Debug /property:Platform=GTA3 /m /fileLogger1 /fileLoggerParameters1:warningsOnly;errorsOnly;logfile=output.log | |
| powershell -Command "(gc output.log) | sort | get-unique > output.log" | |
| powershell -Command "(gc output.log) -replace ' \d>','' -replace '.:\\a\\plugin-sdk\\plugin-sdk\\','' | Out-File -encoding ASCII output.log" | |
| powershell -Command "foreach($line in Get-Content 'output.log') { $m = $line -match '^(.*)\((\d+),(\d+)\): (\w+) (.*) \[.*\]$'; if ($m) {$m = $Matches; echo ('::'+$m[4]+' file='+$m[1]+',line='+$m[2]+',title=Test plugin compilation::'+$m[5])} else {echo ('::error title=Test plugin compilation::' + $line)} }" | |
| for %%R in (output.log) do if not %%~zR lss 1 (exit 1) | |
| echo ::groupEnd:: |