chore: add workflows

This commit is contained in:
Stevan Freeborn
2024-07-07 15:07:42 -05:00
parent 3969937ffa
commit ebbae05a22
3 changed files with 133 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
name: Pull Request
on:
pull_request:
paths-ignore:
- "**/.gitignore"
- "**/.editorconfig"
- .github/**
- .vscode/**
branches:
- master
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore
- name: Format code
run: dotnet format --check --verbosity diagnosticdotnet format --verify-no-changes --verbosity diagnostic
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Install report generator
run: dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.3.7
- name: Restore dependencies
run: dotnet restore
- name: Run tests
env:
SKIP_EXAMPLES: true
run: dotnet test
- name: Upload html coverage report
uses: actions/upload-artifact@v4
with:
name: html-report
path: tests/AnthropicClient.Tests/TestResults/coverage/report/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: tests/AnthropicClient.Tests/TestResults/coverage/coverage.cobertura.xml