diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..bdb24a9f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,64 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + x64_build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build solution + run: msbuild LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x64 + + - name: Install VsTest + run: | + nuget.exe install Microsoft.TestPlatform -Version 17.11.0 -Source https://api.nuget.org/v3/index.json -OutputDirectory D:\a\_temp\VsTest -NoCache -DirectDownload -NonInteractive + echo "D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Run tests + run: vstest.console.exe **\*test*.dll /Platform:x64 + + - name: Publish artifact + uses: actions/upload-artifact@v3 + with: + name: 64-bit + path: LogMonitor\x64\Release + + x86_build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build solution + run: msbuild LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x86 + + - name: Install VsTest + run: | + nuget.exe install Microsoft.TestPlatform -Version 17.11.0 -Source https://api.nuget.org/v3/index.json -OutputDirectory D:\a\_temp\VsTest -NoCache -DirectDownload -NonInteractive + echo "D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Run tests + run: vstest.console.exe **\*test*.dll /Platform:x86 + + - name: Publish artifact + uses: actions/upload-artifact@v3 + with: + name: 32-bit + path: LogMonitor\Release \ No newline at end of file