-
Notifications
You must be signed in to change notification settings - Fork 11
38 lines (34 loc) · 1.48 KB
/
inspect.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: inspect
on: [pull_request]
jobs:
inspect:
runs-on: ubuntu-latest
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: actions/checkout@v2
- name: install resharper
run: dotnet tool install -g JetBrains.ReSharper.GlobalTools
- name: build solution before analysis
run: dotnet build
- name: determine changed files
uses: lots0logs/gh-action-get-changed-files@2.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: run resharper
run: |
changed_files=$(jq --raw-output 'join(";")' "${HOME}/files.json")
echo "Changed files: $changed_files"
jb inspectcode --severity=WARNING --format=Json --output=_rs_inspections --include="$changed_files" tpp-core.sln || echo "ReSharper failed, likely because the filter resulted in no files being analyzed"
- name: process resharper inspections
run: |
if [ -d "./_rs_inspections" ]; then
for filename in ./_rs_inspections/*.json; do
jq --raw-output '.problems[] | "::\(.problem_class.severity) file=\(.file | gsub("\\\\";"/") | sub("\\$PROJECT_DIR\\$/";"")),line=\(.line),col=\(.offset)::\(.description)"' "$filename"
done
fi
# - name: check code formatting
# run: |
# dotnet format --verify-no-changes --report=_format_report.json || python .github/workflows/process_format_report.py