From 9852caeb85e5963db3a6a0ff04c045891d696174 Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:03:23 +0800 Subject: [PATCH 1/8] Create auto-build.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加自动编译工作流 --- .github/workflows/auto-build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/auto-build.yml diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml new file mode 100644 index 0000000..f12d9db --- /dev/null +++ b/.github/workflows/auto-build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup MSBuild path + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Restore dependencies + run: nuget restore + + - name: Build the application + run: msbuild /p:Configuration=Release /t:Build From 8b6d1248b7030173317b9a78266e9fe82c0cbb46 Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:21:27 +0800 Subject: [PATCH 2/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 38 +++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index f12d9db..dc17bfb 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -1,25 +1,33 @@ -name: Build +name: Build and Test on: push: - branches: - - '**' + branches: [ main ] pull_request: - branches: - - '**' - + branches: [ main ] + jobs: build: runs-on: windows-latest - + steps: - - uses: actions/checkout@v3 - - - name: Setup MSBuild path + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.0.2 - - - name: Restore dependencies + + - name: Restore NuGet packages run: nuget restore - - - name: Build the application - run: msbuild /p:Configuration=Release /t:Build + + - name: Build solution + run: msbuild /t:restore /t:build /p:Configuration=Release + + - name: Run tests + run: vstest.console.exe bin\Release\LyricEditor.Tests.dll + + - name: Publish application + uses: actions/upload-artifact@v2 + with: + name: LyricEditor + path: bin\Release\LyricEditor.exe From 22b0f5afec24acddc75a76850d9fac20faf0a86b Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:22:53 +0800 Subject: [PATCH 3/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index dc17bfb..31a3796 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -2,9 +2,7 @@ name: Build and Test on: push: - branches: [ main ] pull_request: - branches: [ main ] jobs: build: From b115f8122ed722540bcb24280e365365682969cd Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:38:45 +0800 Subject: [PATCH 4/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 31a3796..b573127 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -21,8 +21,15 @@ jobs: - name: Build solution run: msbuild /t:restore /t:build /p:Configuration=Release + - name: Install Test Platform + run: | + $url = "https://download.visualstudio.microsoft.com/download/pr/9c5f6087-5b4e-4650-a05c-4ec05b83c598/b8d15fb36766d5ea060813a817d99582/vs_TestAgent.exe" + Invoke-WebRequest -Uri $url -OutFile vs_TestAgent.exe + .\vs_TestAgent.exe --quiet --norestart + - name: Run tests - run: vstest.console.exe bin\Release\LyricEditor.Tests.dll + run: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe bin\Release\LyricEditor.Tests.dll + - name: Publish application uses: actions/upload-artifact@v2 From ca79b39190b4215dc58d8c32d5460318910ad833 Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:44:14 +0800 Subject: [PATCH 5/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index b573127..58c12a6 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -21,15 +21,14 @@ jobs: - name: Build solution run: msbuild /t:restore /t:build /p:Configuration=Release - - name: Install Test Platform - run: | - $url = "https://download.visualstudio.microsoft.com/download/pr/9c5f6087-5b4e-4650-a05c-4ec05b83c598/b8d15fb36766d5ea060813a817d99582/vs_TestAgent.exe" - Invoke-WebRequest -Uri $url -OutFile vs_TestAgent.exe - .\vs_TestAgent.exe --quiet --norestart - - - name: Run tests - run: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe bin\Release\LyricEditor.Tests.dll - +# - name: Install Test Platform +# run: | +# $url = "https://download.visualstudio.microsoft.com/download/pr/9c5f6087-5b4e-4650-a05c-4ec05b83c598/b8d15fb36766d5ea060813a817d99582/vs_TestAgent.exe" +# Invoke-WebRequest -Uri $url -OutFile vs_TestAgent.exe +# .\vs_TestAgent.exe --quiet --norestart + +# - name: Run tests +# run: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe bin\Release\LyricEditor.Tests.dll - name: Publish application uses: actions/upload-artifact@v2 From fccbd3a57ced789bfa1d4b5e06285e80d2ed91af Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 20:50:16 +0800 Subject: [PATCH 6/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 58c12a6..8bb12f0 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -30,8 +30,8 @@ jobs: # - name: Run tests # run: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe bin\Release\LyricEditor.Tests.dll - - name: Publish application - uses: actions/upload-artifact@v2 + - name: Upload Artifact + uses: actions/upload-artifact@v3 with: name: LyricEditor path: bin\Release\LyricEditor.exe From e93e302bf34a76e3f5f319671d2bbde5008c413c Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 21:00:18 +0800 Subject: [PATCH 7/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 8bb12f0..ea712f8 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -34,4 +34,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: LyricEditor - path: bin\Release\LyricEditor.exe + path: D:\a\LyricEditor\LyricEditor\LyricEditor\bin\Release\LyricEditor.exe From 3476bf30a17691d4cb3163698638c7cf6f304fcd Mon Sep 17 00:00:00 2001 From: shitlime <31384673+shitlime@users.noreply.github.com> Date: Tue, 20 Jun 2023 21:06:01 +0800 Subject: [PATCH 8/8] Update auto-build.yml --- .github/workflows/auto-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index ea712f8..3d81f47 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -34,4 +34,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: LyricEditor - path: D:\a\LyricEditor\LyricEditor\LyricEditor\bin\Release\LyricEditor.exe + path: D:\a\LyricEditor\LyricEditor\LyricEditor\bin\Release\*