test.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. name: Tests
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. jobs:
  6. format:
  7. name: Format Check
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout
  11. uses: actions/checkout@v4
  12. - name: Setup .NET
  13. uses: actions/setup-dotnet@v4
  14. with:
  15. dotnet-version: 10.0.x
  16. - name: Restore
  17. run: dotnet restore
  18. - name: Check Formatting
  19. run: dotnet format --verify-no-changes
  20. cli-tests:
  21. name: CLI Tests
  22. runs-on: ubuntu-latest
  23. needs: format
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@v4
  27. - name: Setup .NET
  28. uses: actions/setup-dotnet@v4
  29. with:
  30. dotnet-version: 10.0.x
  31. - name: Restore
  32. run: dotnet restore
  33. - name: Build
  34. run: dotnet build --no-restore --configuration Release
  35. - name: Run CLI Tests
  36. run: dotnet test Tests --no-build --configuration Release --verbosity normal
  37. webui-tests:
  38. name: WebUI / Playwright Tests
  39. runs-on: ubuntu-24.04
  40. needs: cli-tests
  41. steps:
  42. - name: Checkout
  43. uses: actions/checkout@v4
  44. - name: Setup .NET
  45. uses: actions/setup-dotnet@v4
  46. with:
  47. dotnet-version: 10.0.x
  48. - name: Cache NuGet
  49. uses: actions/cache@v4
  50. with:
  51. path: ~/.nuget/packages
  52. key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/packages.lock.json') }}
  53. restore-keys: |
  54. ${{ runner.os }}-nuget-
  55. - name: Cache Playwright browsers
  56. uses: actions/cache@v4
  57. with:
  58. path: ~/.cache/ms-playwright
  59. key: ${{ runner.os }}-pw-chromium-${{ hashFiles('**/*.csproj') }}
  60. restore-keys: |
  61. ${{ runner.os }}-pw-chromium-
  62. - name: Restore
  63. run: dotnet restore
  64. - name: Build
  65. run: dotnet build --no-restore --configuration Release
  66. - name: Install Playwright Browsers
  67. shell: bash
  68. run: |
  69. pwsh Tests.E2e/bin/Release/net*/playwright.ps1 install --with-deps chromium
  70. - name: Build Docker Image
  71. run: |
  72. docker build \
  73. -t rackpeek:ci \
  74. -f RackPeek.Web/Dockerfile \
  75. .
  76. - name: Run E2E Tests
  77. run: dotnet test Tests.E2e --configuration Release --verbosity normal