# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: Inspect Code on: push: # Explicitly specifying this results in tags being ignored, which is the goal. branches: ["**"] paths: - .github/workflows/inspect-code.yml - '**.cs' pull_request: paths: - .github/workflows/inspect-code.yml - '**.cs' env: baseRef: ${{ github.ref == 'refs/heads/master' && github.event.before || (github.event.base_ref || github.event.pull_request.base.ref || 'master') }} dotnetVersion: 9.0.x jobs: inspect: name: Resharper Inspect Code runs-on: ubuntu-latest steps: - name: Checkout Source Code uses: actions/checkout@v4 with: fetch-depth: 0 # avoid shallow clone for GitVersion - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnetVersion }} - name: Restore run: dotnet restore - name: Inspect Code uses: muno92/resharper_inspectcode@1.11.11 with: solutionPath: Recyclarr.sln minimumSeverity: warning include: '**.cs' cleanup: name: Resharper Code Cleanup runs-on: ubuntu-latest # Temporarily disable this job until this issue is resolved: # https://youtrack.jetbrains.com/issue/RSRP-499679 if: false steps: - name: Checkout Source Code uses: actions/checkout@v4 with: fetch-depth: 0 # avoid shallow clone for GitVersion - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnetVersion }} # - name: Build # run: dotnet build - name: Run Code Cleanup run: | dotnet tool restore ci/code_cleanup.sh - name: Check Diff run: | ci/diff_to_errors.sh set -o pipefail git diff --exit-code | tee code-cleanup.patch - name: Publish Patch File uses: actions/upload-artifact@v4.5.0 if: failure() with: name: code-cleanup-patch-files path: '*.patch' style: name: CSharpier Style runs-on: ubuntu-latest steps: - name: Checkout Source Code uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.dotnetVersion }} - name: Run CSharpier run: | dotnet tool restore dotnet csharpier --check .