Skip to content

deps: Update actions/checkout action to v7 #41

deps: Update actions/checkout action to v7

deps: Update actions/checkout action to v7 #41

Workflow file for this run

name: Tests and Coverage
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Setup .NET SDKs
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore ancpdevkit.sln
- name: Build
run: dotnet build ancpdevkit.sln --no-restore --configuration Release
- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Run tests with coverage
run: |
~/.dotnet/tools/dotnet-coverage collect "dotnet test ancpdevkit.sln --no-build --configuration Release --logger:\"trx;LogFileName=test_results.trx\"" \
-f cobertura -o "coverage.cobertura.xml"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.cobertura.xml
fail_ci_if_error: false