41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
name: Pull Request
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "src/**"
|
|
jobs:
|
|
format:
|
|
name: Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup .NET 9
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 9.0.x
|
|
- name: Format code
|
|
run: dotnet format src --verify-no-changes --verbosity diagnostic
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup .NET 9
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 9.0.x
|
|
- name: Install report generator
|
|
run: dotnet tool install -g dotnet-reportgenerator-globaltool
|
|
- name: Run tests
|
|
run: dotnet test src
|
|
- name: Upload code coverage
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: html-report
|
|
path: src/StevesBot.Worker.Tests/TestResults/Coverage/Report/
|