Bump codecov/codecov-action from 3 to 4 #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Install Dependencies | |
run: dotnet restore ObjPropsDynamicSetter.sln | |
- name: Build | |
run: dotnet build ObjPropsDynamicSetter.sln -c Release --no-restore | |
- name: Run Unit Tests | |
run: dotnet test test/*.Unit/*.csproj -c Release --no-restore --no-build --collect:"XPlat Code Coverage" | |
- name: Upload Coverage Report to Codecov | |
uses: codecov/codecov-action@v4 | |
mutation-tests: | |
needs: test | |
runs-on: ubuntu-latest | |
if: ${{ github.repository == 'Molnix888/obj-props-dynamic-setter' && github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Install Stryker | |
run: dotnet tool install -g dotnet-stryker | |
- name: Mutation Tests | |
run: | | |
cd test/*.Unit | |
dotnet stryker -level Complete -ca perTestInIsolation -r "['dashboard']" --dashboard-api-key "${{ secrets.STRYKER_API_KEY }}" --dashboard-project "github.com/Molnix888/obj-props-dynamic-setter" --dashboard-version "${GITHUB_REF##*/}" | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Use GitVersion | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Add GitHub Packages Source | |
run: dotnet nuget add source https://nuget.pkg.github.com/Molnix888/index.json -n github -u Molnix888 -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text | |
- name: Pack | |
run: dotnet pack src/ObjPropsDynamicSetter/*.csproj -o nuget -c Release -p:PackageVersion=${{ steps.gitversion.outputs.semVer }} | |
- name: Publish to NuGet | |
run: dotnet nuget push nuget/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json -n --skip-duplicate | |
- name: Publish to GitHub Packages | |
run: dotnet nuget push nuget/*.nupkg -s "github" -n true --skip-duplicate |