mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +00:00
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
name: CI Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop, net8-updates ]
|
|
pull_request:
|
|
branches: [ main, develop, net8-updates ]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build
|
|
run: dotnet build --configuration Release --no-restore
|
|
|
|
- name: Run tests
|
|
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
|
|
|
|
- name: Generate coverage report
|
|
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.0
|
|
with:
|
|
reports: coverage/**/coverage.cobertura.xml
|
|
targetdir: coverage-report
|
|
reporttypes: Html;Cobertura;MarkdownSummary
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage-report/Cobertura.xml
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|
|
|
|
- name: Write coverage summary
|
|
run: cat coverage-report/Summary.md >> $GITHUB_STEP_SUMMARY
|
|
if: always()
|
|
|
|
- name: Upload test results
|
|
uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: test-results
|
|
path: |
|
|
coverage/
|
|
coverage-report/ |