Skip to content

chore(test): Refactor Core directory in the Crowdin.Api.Tests #248

chore(test): Refactor Core directory in the Crowdin.Api.Tests

chore(test): Refactor Core directory in the Crowdin.Api.Tests #248

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- 'main'
push:
branches:
- '*'
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'CODE_OF_CONDUCT.md'
- 'CONTRIBUTING.md'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '3.1.x', '7.0.x' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
code-coverage:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Test
run: dotnet test --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
- name: Generate code coverage report
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.3
with:
reports: '**/coverage.cobertura.xml'
targetdir: 'CodeCoverage'
reporttypes: 'Cobertura'
- name: Publish code coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: '**/coverage.cobertura.xml'