Skip to content

Commit

Permalink
[CI] Add the dotnet linter to our Gitlab CI (#26611)
Browse files Browse the repository at this point in the history
  • Loading branch information
amenasria authored Jun 14, 2024
1 parent 510f163 commit 6f3d8c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ variables:
# To use images from datadog-agent-buildimages dev branches, set the corresponding
# SUFFIX variable to _test_only
DATADOG_AGENT_BUILDIMAGES_SUFFIX: ""
DATADOG_AGENT_BUILDIMAGES: v35901572-a9447181
DATADOG_AGENT_BUILDIMAGES: v36675054-482032aa
DATADOG_AGENT_WINBUILDIMAGES_SUFFIX: ""
DATADOG_AGENT_WINBUILDIMAGES: v35901572-a9447181
DATADOG_AGENT_WINBUILDIMAGES: v36675054-482032aa
DATADOG_AGENT_ARMBUILDIMAGES_SUFFIX: ""
DATADOG_AGENT_ARMBUILDIMAGES: v35901572-a9447181
DATADOG_AGENT_ARMBUILDIMAGES: v36675054-482032aa
DATADOG_AGENT_SYSPROBE_BUILDIMAGES_SUFFIX: ""
DATADOG_AGENT_SYSPROBE_BUILDIMAGES: v35901572-a9447181
DATADOG_AGENT_SYSPROBE_BUILDIMAGES: v36675054-482032aa
DATADOG_AGENT_BTF_GEN_BUILDIMAGES_SUFFIX: ""
DATADOG_AGENT_BTF_GEN_BUILDIMAGES: v35901572-a9447181
DATADOG_AGENT_BTF_GEN_BUILDIMAGES: v36675054-482032aa

DATADOG_AGENT_EMBEDDED_PATH: /opt/datadog-agent/embedded
DEB_GPG_KEY_ID: c0962c7d
Expand Down
18 changes: 15 additions & 3 deletions tasks/winbuildscripts/lint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ if($err -ne 0){
}

& inv -e install-tools
& inv -e linter.go

& inv -e linter.go
$err = $LASTEXITCODE
Write-Host Lint result is $err
Write-Host Go linter result is $err
if($err -ne 0){
Write-Host -ForegroundColor Red "lint failed $err"
Write-Host -ForegroundColor Red "go linter failed $err"
[Environment]::Exit($err)
}

$timeTaken = Measure-Command {
& dotnet format --verify-no-changes .\\tools\\windows\\DatadogAgentInstaller
$err = $LASTEXITCODE
Write-Host Dotnet linter result is $err
if($err -ne 0){
Write-Host -ForegroundColor Red "dotnet linter failed $err"
[Environment]::Exit($err)
}
}

Write-Host "Dotnet linter run time: $($timeTaken.TotalSeconds) seconds"

0 comments on commit 6f3d8c8

Please sign in to comment.