Skip to content

Commit 17827df

Browse files
committed
zz
1 parent 7768bff commit 17827df

File tree

1 file changed

+88
-88
lines changed

1 file changed

+88
-88
lines changed

.github/workflows/dotnet.yml

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ jobs:
7070
- name: Print messages
7171
shell: pwsh
7272
env:
73-
MY_MSG: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
73+
MY_MSG: ${{ github.event.pull_request.merged == true && ('#' + github.event.pull_request.number) || github.sha }}
7474
run: |
7575
# github.event.pull_request.merged == true
76-
Write-Host "Message = "$env:MY_MSG"
76+
Write-Host "Message = $env:MY_MSG"
7777
- name: Dump event object
7878
run: |
7979
echo "${{toJSON(github.event)}}"
@@ -158,97 +158,97 @@ jobs:
158158
name: documentation
159159
path: docs/_site
160160

161-
inspect-code:
162-
timeout-minutes: 60
163-
strategy:
164-
fail-fast: false
165-
matrix:
166-
os: [ubuntu-latest, windows-latest, macos-latest]
167-
runs-on: ${{ matrix.os }}
168-
steps:
169-
- name: Git checkout
170-
uses: actions/checkout@v3
171-
- name: Setup .NET
172-
uses: actions/setup-dotnet@v3
173-
with:
174-
dotnet-version: 6.0.x
175-
- name: Restore tools
176-
run: |
177-
dotnet tool restore
178-
- name: InspectCode
179-
shell: pwsh
180-
run: |
181-
$inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
182-
Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
183-
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$inspectCodeOutputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
184-
- name: Verify outcome
185-
shell: pwsh
186-
run: |
187-
[xml]$xml = Get-Content $env:INSPECT_CODE_OUTPUT_PATH
188-
if ($xml.report.Issues -and $xml.report.Issues.Project) {
189-
foreach ($project in $xml.report.Issues.Project) {
190-
if ($project.Issue.Count -gt 0) {
191-
$project.ForEach({
192-
Write-Output "`nProject $($project.Name)"
193-
$failed = $true
161+
# inspect-code:
162+
# timeout-minutes: 60
163+
# strategy:
164+
# fail-fast: false
165+
# matrix:
166+
# os: [ubuntu-latest, windows-latest, macos-latest]
167+
# runs-on: ${{ matrix.os }}
168+
# steps:
169+
# - name: Git checkout
170+
# uses: actions/checkout@v3
171+
# - name: Setup .NET
172+
# uses: actions/setup-dotnet@v3
173+
# with:
174+
# dotnet-version: 6.0.x
175+
# - name: Restore tools
176+
# run: |
177+
# dotnet tool restore
178+
# - name: InspectCode
179+
# shell: pwsh
180+
# run: |
181+
# $inspectCodeOutputPath = Join-Path $env:RUNNER_TEMP 'jetbrains-inspectcode-results.xml'
182+
# Write-Output "INSPECT_CODE_OUTPUT_PATH=$inspectCodeOutputPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
183+
# dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$inspectCodeOutputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=GlobalPerProduct -dsl=SolutionPersonal -dsl=ProjectPersonal
184+
# - name: Verify outcome
185+
# shell: pwsh
186+
# run: |
187+
# [xml]$xml = Get-Content $env:INSPECT_CODE_OUTPUT_PATH
188+
# if ($xml.report.Issues -and $xml.report.Issues.Project) {
189+
# foreach ($project in $xml.report.Issues.Project) {
190+
# if ($project.Issue.Count -gt 0) {
191+
# $project.ForEach({
192+
# Write-Output "`nProject $($project.Name)"
193+
# $failed = $true
194194

195-
$_.Issue.ForEach({
196-
$issueType = $xml.report.IssueTypes.SelectSingleNode("IssueType[@Id='$($_.TypeId)']")
197-
$severity = $_.Severity ?? $issueType.Severity
195+
# $_.Issue.ForEach({
196+
# $issueType = $xml.report.IssueTypes.SelectSingleNode("IssueType[@Id='$($_.TypeId)']")
197+
# $severity = $_.Severity ?? $issueType.Severity
198198

199-
Write-Output "[$severity] $($_.File):$($_.Line) $($_.TypeId): $($_.Message)"
200-
})
201-
})
202-
}
203-
}
199+
# Write-Output "[$severity] $($_.File):$($_.Line) $($_.TypeId): $($_.Message)"
200+
# })
201+
# })
202+
# }
203+
# }
204204

205-
if ($failed) {
206-
Write-Error "One or more projects failed code inspection."
207-
}
208-
else {
209-
Write-Output "No issues found."
210-
}
211-
}
205+
# if ($failed) {
206+
# Write-Error "One or more projects failed code inspection."
207+
# }
208+
# else {
209+
# Write-Output "No issues found."
210+
# }
211+
# }
212212

213-
cleanup-code:
214-
timeout-minutes: 60
215-
strategy:
216-
fail-fast: false
217-
matrix:
218-
os: [ubuntu-latest, windows-latest, macos-latest]
219-
runs-on: ${{ matrix.os }}
220-
steps:
221-
- name: Git checkout
222-
uses: actions/checkout@v3
223-
with:
224-
fetch-depth: 2
225-
- name: Setup .NET
226-
uses: actions/setup-dotnet@v3
227-
with:
228-
dotnet-version: 6.0.x
229-
- name: Restore tools
230-
run: |
231-
dotnet tool restore
232-
- name: Restore packages
233-
run: |
234-
dotnet restore
235-
- name: CleanupCode (on PR diff)
236-
if: github.event_name == 'pull_request'
237-
shell: pwsh
238-
run: |
239-
# Not using the environment variables for SHAs, because they may be outdated. This happens on force-push after the build is queued, but before it starts.
240-
# The below works because HEAD is detached (at the merge commit), so HEAD~1 is at the base branch. When a PR contains no commits, this job will not run.
241-
$headCommitHash = git rev-parse HEAD
242-
$baseCommitHash = git rev-parse HEAD~1
213+
# cleanup-code:
214+
# timeout-minutes: 60
215+
# strategy:
216+
# fail-fast: false
217+
# matrix:
218+
# os: [ubuntu-latest, windows-latest, macos-latest]
219+
# runs-on: ${{ matrix.os }}
220+
# steps:
221+
# - name: Git checkout
222+
# uses: actions/checkout@v3
223+
# with:
224+
# fetch-depth: 2
225+
# - name: Setup .NET
226+
# uses: actions/setup-dotnet@v3
227+
# with:
228+
# dotnet-version: 6.0.x
229+
# - name: Restore tools
230+
# run: |
231+
# dotnet tool restore
232+
# - name: Restore packages
233+
# run: |
234+
# dotnet restore
235+
# - name: CleanupCode (on PR diff)
236+
# if: github.event_name == 'pull_request'
237+
# shell: pwsh
238+
# run: |
239+
# # Not using the environment variables for SHAs, because they may be outdated. This happens on force-push after the build is queued, but before it starts.
240+
# # The below works because HEAD is detached (at the merge commit), so HEAD~1 is at the base branch. When a PR contains no commits, this job will not run.
241+
# $headCommitHash = git rev-parse HEAD
242+
# $baseCommitHash = git rev-parse HEAD~1
243243

244-
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
245-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
246-
- name: CleanupCode (on branch)
247-
if: github.event_name == 'push'
248-
shell: pwsh
249-
run: |
250-
Write-Output "Running code cleanup on all files."
251-
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
244+
# Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
245+
# dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --max-runs=5 --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
246+
# - name: CleanupCode (on branch)
247+
# if: github.event_name == 'push'
248+
# shell: pwsh
249+
# run: |
250+
# Write-Output "Running code cleanup on all files."
251+
# dotnet regitlint -s JsonApiDotNetCore.sln --print-command --skip-tool-check --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
252252

253253
publish:
254254
timeout-minutes: 60

0 commit comments

Comments
 (0)