From 14d370c7b1d7705bec430e561d8a906d56a0abcd Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Tue, 20 Aug 2024 14:17:37 +0300 Subject: [PATCH 1/7] setup github actions --- .github/workflows/test.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..4c3ce547 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + x64_build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@v1 + + - name: Build solution + run: msbuild /p:Configuration=Release /p:Platform=x64 + + - name: Run tests + run: vstest.console.exe **\*test*.dll /Platform:x64 /Framework:Framework45 + + - name: Publish artifact + uses: actions/upload-artifact@v2 + with: + name: 64-bit + path: LogMonitor\x64\Release + + x86_build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@v1 + + - name: Build solution + run: msbuild /p:Configuration=Release /p:Platform=x86 + + - name: Run tests + run: vstest.console.exe **\*test*.dll /Platform:x86 /Framework:Framework45 + + - name: Publish artifact + uses: actions/upload-artifact@v2 + with: + name: 32-bit + path: LogMonitor\Release \ No newline at end of file From a9220de26e39e69f9f8df6c490bac7b0ce9a4370 Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Tue, 20 Aug 2024 14:47:33 +0300 Subject: [PATCH 2/7] fix build command --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c3ce547..27562340 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,19 +14,19 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up MSBuild - uses: microsoft/setup-msbuild@v1 + uses: microsoft/setup-msbuild@v2 - name: Build solution - run: msbuild /p:Configuration=Release /p:Platform=x64 + run: msbuild LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x64 - name: Run tests run: vstest.console.exe **\*test*.dll /Platform:x64 /Framework:Framework45 - name: Publish artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 64-bit path: LogMonitor\x64\Release @@ -36,19 +36,19 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up MSBuild - uses: microsoft/setup-msbuild@v1 + uses: microsoft/setup-msbuild@v2 - name: Build solution - run: msbuild /p:Configuration=Release /p:Platform=x86 + run: msbuild LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x86 - name: Run tests run: vstest.console.exe **\*test*.dll /Platform:x86 /Framework:Framework45 - name: Publish artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: 32-bit path: LogMonitor\Release \ No newline at end of file From e337b58ec5cbf4b71449ee1b1413624a1d5f844a Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Tue, 20 Aug 2024 15:14:00 +0300 Subject: [PATCH 3/7] use vs-test github action --- .github/workflows/test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27562340..02f6f02e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,9 +21,13 @@ jobs: - name: Build solution run: msbuild LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x64 - + - name: Run tests - run: vstest.console.exe **\*test*.dll /Platform:x64 /Framework:Framework45 + uses: microsoft/vstest-action@v1.0.0 + with: + searchFolder: '.' + testAssembly: | + /**/*test*.dll - name: Publish artifact uses: actions/upload-artifact@v3 @@ -45,6 +49,7 @@ jobs: run: msbuild LogMonitor\LogMonitor.sln /p:Configuration=Release /p:Platform=x86 - name: Run tests + run: vstest.console.exe **\*test*.dll /Platform:x86 /Framework:Framework45 - name: Publish artifact From 6e07ef3c4d33e7f13f8f29018cd03c8459cf7dcd Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Wed, 21 Aug 2024 10:15:07 +0300 Subject: [PATCH 4/7] install vstest --- .github/workflows/test.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02f6f02e..8bda36cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,13 +21,12 @@ jobs: - 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 - name: Run tests - uses: microsoft/vstest-action@v1.0.0 - with: - searchFolder: '.' - testAssembly: | - /**/*test*.dll + run: vstest.console.exe **\*test*.dll /Platform:x64 - name: Publish artifact uses: actions/upload-artifact@v3 @@ -48,9 +47,11 @@ jobs: - 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 + - name: Run tests - - run: vstest.console.exe **\*test*.dll /Platform:x86 /Framework:Framework45 + run: vstest.console.exe **\*test*.dll /Platform:x86 - name: Publish artifact uses: actions/upload-artifact@v3 From ee56a9ecde18194b39d1830e987cf8f433f8cb74 Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Wed, 21 Aug 2024 10:30:30 +0300 Subject: [PATCH 5/7] set vstest path --- .github/workflows/test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bda36cd..0213bd2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,10 +23,12 @@ jobs: 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 + 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 "$VSTEST_PATH=D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" >> $GITHUB_ENV - name: Run tests - run: vstest.console.exe **\*test*.dll /Platform:x64 + run: $VSTEST_PATH **\*test*.dll /Platform:x64 - name: Publish artifact uses: actions/upload-artifact@v3 @@ -48,7 +50,9 @@ jobs: 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 + 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 "$VSTEST_PATH=D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" >> $GITHUB_ENV - name: Run tests run: vstest.console.exe **\*test*.dll /Platform:x86 From d227f0dfe23d34d8896cab82fc2b99e65f27097f Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Wed, 21 Aug 2024 15:02:13 +0300 Subject: [PATCH 6/7] use github_path variable --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0213bd2e..0bfb8e73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,10 +25,10 @@ jobs: - 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 "$VSTEST_PATH=D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" >> $GITHUB_ENV + echo "D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\" >> $GITHUB_PATH - name: Run tests - run: $VSTEST_PATH **\*test*.dll /Platform:x64 + run: vstest.console.exe **\*test*.dll /Platform:x64 - name: Publish artifact uses: actions/upload-artifact@v3 @@ -52,7 +52,7 @@ jobs: - 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 "$VSTEST_PATH=D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" >> $GITHUB_ENV + echo "D:\a\_temp\VsTest\Microsoft.TestPlatform.17.11.0\tools\net462\Common7\IDE\Extensions\TestPlatform\" >> $GITHUB_PATH - name: Run tests run: vstest.console.exe **\*test*.dll /Platform:x86 From 7ccf8138a3a8c1aacbf4e40c87cfea7971eab6ca Mon Sep 17 00:00:00 2001 From: Ian King'ori Date: Wed, 21 Aug 2024 15:06:43 +0300 Subject: [PATCH 7/7] use github_path variable - powershell syntax --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0bfb8e73..bdb24a9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: - 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\" >> $GITHUB_PATH + 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 @@ -52,7 +52,7 @@ jobs: - 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\" >> $GITHUB_PATH + 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