Skip to content

Commit

Permalink
Update GitHub Actions references
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Jul 19, 2024
1 parent b8d5d41 commit 2255a47
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
51 changes: 20 additions & 31 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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'

Expand All @@ -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}}
Expand All @@ -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' }}
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 2255a47

Please sign in to comment.