From a29daac647b684199bd0af72dc93c9245367daed Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Fri, 23 May 2025 22:17:54 -0500 Subject: [PATCH] chore: add pull_request workflow --- .github/workflows/pull_request.yml | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/pull_request.yml 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/