From 2255a47a7ee2df1490797fae540c52e088696c16 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Thu, 18 Jul 2024 20:15:23 +0300 Subject: [PATCH] Update GitHub Actions references --- .github/workflows/build-test.yml | 51 +++++++++++---------------- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 10 +++--- 3 files changed, 26 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a77a0e278..2b9e126cc 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -19,17 +19,17 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - target: [netstandard2.0, netstandard2.1, net6.0] + target: [netstandard2.0, netstandard2.1, net6.0, net462] env: LIB_PROJ: src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.events.inputs.tag }} fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' @@ -51,13 +51,13 @@ jobs: os: [ubuntu, macos] target: [net6.0] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup .NET Core if: matrix.target == 'net6.0' - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' @@ -73,44 +73,37 @@ jobs: CodeCov: name: Code Coverage - runs-on: windows-2019 + runs-on: windows-latest env: - DOTCOVER_VER: 2021.1.2 - DOTCOVER_PKG: jetbrains.dotcover.commandlinetools + DOTCOVER_VER: 2024.1.4 + DOTCOVER_PKG: JetBrains.dotCover.CommandLineTools COVER_SNAPSHOT: SharpZipLib.dcvr steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' - # NOTE: This is the temporary fix for https://github.com/actions/virtual-environments/issues/1090 - - name: Cleanup before restore - run: dotnet clean ICSharpCode.SharpZipLib.sln && dotnet nuget locals all --clear - - name: Install codecov - run: nuget install -o tools -version ${{env.DOTCOVER_VER}} ${{env.DOTCOVER_PKG}} - - - name: Add dotcover to path - run: echo "$(pwd)\tools\${{env.DOTCOVER_PKG}}.${{env.DOTCOVER_VER}}\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + run: dotnet tool install ${{env.DOTCOVER_PKG}} --global --version ${{env.DOTCOVER_VER}} - name: Run tests with code coverage - run: dotcover dotnet --output=${{env.COVER_SNAPSHOT}} --filters=-:ICSharpCode.SharpZipLib.Tests -- test -c release + run: dotnet-dotCover dotnet --output=${{env.COVER_SNAPSHOT}} --filters=-:ICSharpCode.SharpZipLib.Tests -- test -c Release - name: Create code coverage report - run: dotcover report --source=${{env.COVER_SNAPSHOT}} --reporttype=detailedxml --output=dotcover-report.xml + run: dotnet-dotCover report --source=${{env.COVER_SNAPSHOT}} --reporttype=detailedxml --output=dotcover-report.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.2.2 + uses: codecov/codecov-action@v4 with: files: dotcover-report.xml - name: Upload coverage snapshot artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Code coverage snapshot path: ${{env.COVER_SNAPSHOT}} @@ -124,22 +117,18 @@ jobs: PKG_PROPS: '/p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.events.inputs.tag }} fetch-depth: 0 - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' - - name: Build library for .NET Standard 2.0 - run: dotnet build -c Release -f netstandard2.0 ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} - - name: Build library for .NET Standard 2.1 - run: dotnet build -c Release -f netstandard2.1 ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} - - name: Build library for .NET 6.0 - run: dotnet build -c Release -f net6.0 ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} + - name: Build library + run: dotnet build -c Release ${{ env.PKG_PROPS }} ${{ env.PKG_PROJ }} - name: Add PR suffix to package if: ${{ github.event_name == 'pull_request' }} @@ -159,7 +148,7 @@ jobs: run: dotnet pack ${{ env.PKG_PROJ }} -c Release --output dist ${{ env.PKG_PROPS }} /p:Version=${{ env.PKG_VERSION }} - name: Upload nuget package artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Nuget package path: dist/*.nupkg diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 54ce5b08b..fa0443ccc 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb6f67445..3f772744d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,12 +16,12 @@ jobs: runs-on: windows-latest name: Generate DocFX documentation steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.events.inputs.tag }} - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: '6.0.x' @@ -35,7 +35,7 @@ jobs: run: docfx docs/help/docfx.json --warningsAsErrors - name: Upload documentation as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: site path: docs/help/_site @@ -46,10 +46,10 @@ jobs: name: Update github pages docs steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download Artifacts # The built project is downloaded into the 'site' folder. - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: site