ci.ps1 938 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Set error handling
  2. $ErrorActionPreference = "Stop"
  3. # Get the root directory and third_party directory
  4. $ROOT_DIR = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent | Split-Path -Parent | Split-Path -Parent -Resolve
  5. # Include the common functions
  6. . "$ROOT_DIR/hack/lib/windows/init.ps1"
  7. function Invoke-CI {
  8. param(
  9. [string[]]$ciArgs
  10. )
  11. & make install @ciArgs
  12. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
  13. & make lint @ciArgs
  14. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
  15. & make test @ciArgs
  16. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
  17. & make validate @ciArgs
  18. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
  19. & make build @ciArgs
  20. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
  21. }
  22. #
  23. # main
  24. #
  25. GPUStack.Log.Info "+++ CI +++"
  26. try {
  27. Invoke-CI $args
  28. } catch {
  29. GPUStack.Log.Fatal "failed run ci: $($_.Exception.Message)"
  30. }
  31. GPUStack.Log.Info "--- CI ---"