Skip to content

Merge pull request #252 from JoeShook/dependabot/nuget/develop/Micros… #398

Merge pull request #252 from JoeShook/dependabot/nuget/develop/Micros…

Merge pull request #252 from JoeShook/dependabot/nuget/develop/Micros… #398

Workflow file for this run

name: .NET
on:
push:
branches: [ main, develop, otelWithExample ]
pull_request:
branches: [ main ]
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
REPOSITORY_URL: https://github.com/JoeShook/ZiggyCreatures.FusionCache.Metrics
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore FusionCache.Plugins.Metrics.DotnetCore.sln
- name: Build
run: dotnet build FusionCache.Plugins.Metrics.DotnetCore.sln --no-restore
- name: Test
run: dotnet test FusionCache.Plugins.Metrics.DotnetCore.sln --no-build --verbosity detailed -p:CollectCoverage=true -p:CoverletOutput=TestResults/ -p:CoverletOutputFormat=opencover
- name: Create Test Coverage Badge for FusionCache.Plugins.Metrics.EventCounters
uses: simon-k/[email protected]
id: create_coverage_badge_EventCounters
with:
label: Unit Test Coverage for EventCounters
color: brightgreen
path: tests/FusionCache.Plugins.Metrics.EventCounters.Tests/TestResults/coverage.opencover.xml
gist-filename: FusionCache.Plugins.Metrics.EventCounters.Plugin-code-coverage.json
gist-id: 141e4a826a0a2f46dad85ccf3213a894
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage ZiggyCreatures.FusionCache.Plugins.Metrics.EventCounters
run: echo "Code coverage percentage for FusionCache.Plugins.Metrics.EventCounters ${{steps.create_coverage_badge_EventCounters.outputs.percentage}}%"
- name: Create Test Coverage Badge for FusionCache.Plugins.Metrics.AppMetrics
uses: simon-k/[email protected]
id: create_coverage_badge_AppMetrics
with:
label: Unit Test Coverage for AppMetrics
color: brightgreen
path: tests/FusionCache.Plugins.Metrics.AppMetrics.Tests/TestResults/coverage.opencover.xml
gist-filename: ZiggyCreatures.FusionCache.Metrics.AppMetrics.Plugin-code-coverage.json
gist-id: 59e2f3ef3dddc3f86e372c161ea501cc
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage FusionCache.Plugins.Metrics.AppMetrics
run: echo "Code coverage percentage for FusionCache.Plugins.Metrics.AppMetrics ${{steps.create_coverage_badge_AppMetrics.outputs.percentage}}%"
# - name: Pack
# run: |
# dotnet pack -v normal -c Release --no-restore --include-source -p:PackageVersion=$GITHUB_RUN_ID src/FusionCache.Plugins.Metrics.Core/FusionCache.Plugins.Metrics.Core.csproj
# dotnet pack -v normal -c Release --no-restore --include-source -p:PackageVersion=$GITHUB_RUN_ID src/FusionCache.Plugins.Metrics.EventCounters/FusionCache.Plugins.Metrics.EventCounters.csproj
# dotnet pack -v normal -c Release --no-restore --include-source -p:PackageVersion=$GITHUB_RUN_ID src/FusionCache.Plugins.Metrics.AppMetrics/FusionCache.Plugins.Metrics.AppMetrics.csproj
# - name: Upload Artifact for Metrics.Core
# uses: actions/upload-artifact@v2
# with:
# name: nupkg
# path: src/FusionCache.Plugins.Metrics.Core/bin/Release/*.symbols.nupkg
# - name: Upload Artifact for EventCounters
# uses: actions/upload-artifact@v2
# with:
# name: nupkg
# path: src/FusionCache.Plugins.Metrics.EventCounters/bin/Release/*.symbols.nupkg
# - name: Upload Artifact for AppMetrics.Plugins
# uses: actions/upload-artifact@v2
# with:
# name: nupkg
# path: src/FusionCache.Plugins.Metrics.AppMetrics/bin/Release/*.symbols.nupkg
# see for inspiration:: https://dusted.codes/github-actions-for-dotnet-core-nuget-packages
# prerelease:
# needs: build
# if: github.ref == 'refs/heads/develop'
# runs-on: ubuntu-latest
# steps:
# - name: Download Artifact
# uses: actions/download-artifact@v1
# with:
# name: nupkg
# - name: Push to GitHub Feed
# run: |
# dotnet tool install gpr -g
# ls ./nupkg
# gpr push ./nupkg/*.nupkg -k $GITHUB_TOKEN --repository $REPOSITORY_URL