diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..1476038 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,40 @@ +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 --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/