Skip to content

chore: multi dotnet versions #7

chore: multi dotnet versions

chore: multi dotnet versions #7

Workflow file for this run

name: build-and-test
on:
pull_request:
push:
branches:
- main
- releases/*
paths:
- "src/**"
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dotnet-version: ["7.0.x", "8.0.x"]
permissions:
checks: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install .NET Core ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore packages
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run unit tests
run: >
dotnet test
--no-restore
--configuration Release
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true;annotations.titleFormat=@test;annotations.messageFormat=@error\n@trace"
/p:CollectCoverage=true
--
RunConfiguration.CollectSourceInformation=true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./reports/coverage/
fail_ci_if_error: false
flags: unittests, ${{ matrix.dotnet-version }}
slug: saan800/saansoft-correlationId