From dfba519e4137f5e9ca0f8a15c14baa21a040a6a7 Mon Sep 17 00:00:00 2001 From: genteure Date: Sat, 4 Jun 2022 14:16:20 +0800 Subject: [PATCH] Optimize GitHub Actions build speed --- .github/workflows/build.yml | 11 ++++------- .github/workflows/release.yml | 9 +++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e9b4cb..ae6fbee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,7 @@ on: env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -24,8 +25,6 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v2 - - name: Restore Packages - run: dotnet restore -v m --disable-parallel - name: Run Tests - Debug run: dotnet test -v m -c Debug @@ -44,12 +43,12 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - name: Restore Packages - run: nuget restore -Verbosity quiet + run: msbuild -t:restore /v:m BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Build WPF - Debug - run: msbuild /nologo /v:m /p:Configuration="Debug" + run: msbuild /nologo /v:m /p:Configuration="Debug" BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Build WPF - Release - run: msbuild /nologo /v:m /p:Configuration="Release" + run: msbuild /nologo /v:m /p:Configuration="Release" BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Upload Artifacts - Debug uses: actions/upload-artifact@v2 @@ -76,8 +75,6 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v2 - - name: Restore Packages - run: dotnet restore -v m --disable-parallel - name: Build CLI - Debug if: ${{ matrix.rid == 'any' }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a3835f..e554ea5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,7 @@ on: env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_GENERATE_ASPNET_CERTIFICATE: false REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -23,8 +24,6 @@ jobs: fetch-depth: 0 - uses: actions/setup-dotnet@v2 - - name: Restore Packages - run: dotnet restore -v m --disable-parallel - name: Run Tests - Debug run: dotnet test -v m -c Debug @@ -45,9 +44,9 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.0.2 - name: Restore Packages - run: nuget restore -Verbosity quiet + run: msbuild -t:restore /v:m BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Build WPF - run: msbuild /nologo /v:m /p:Configuration="${{ matrix.build_configuration }}" + run: msbuild /nologo /v:m /p:Configuration="${{ matrix.build_configuration }}" BililiveRecorder.WPF/BililiveRecorder.WPF.csproj - name: Upload Build Artifacts uses: actions/upload-artifact@v2 with: @@ -85,8 +84,6 @@ jobs: with: fetch-depth: 0 - uses: actions/setup-dotnet@v2 - - name: Restore Packages - run: dotnet restore -v m --disable-parallel - name: Build CLI if: ${{ matrix.rid == 'any' }} run: dotnet publish -c ${{ matrix.build_configuration }} BililiveRecorder.Cli/BililiveRecorder.Cli.csproj