test-webui.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: WebUi Tests
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. jobs:
  6. build:
  7. runs-on: ubuntu-24.04 # pin for consistency (22.04 is also fine)
  8. steps:
  9. - name: Checkout
  10. uses: actions/checkout@v4
  11. - name: Setup .NET
  12. uses: actions/setup-dotnet@v4
  13. with:
  14. dotnet-version: 10.0.x
  15. - name: Cache NuGet
  16. uses: actions/cache@v4
  17. with:
  18. path: ~/.nuget/packages
  19. key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/packages.lock.json') }}
  20. restore-keys: |
  21. ${{ runner.os }}-nuget-
  22. - name: Cache Playwright browsers (Chromium)
  23. uses: actions/cache@v4
  24. with:
  25. path: ~/.cache/ms-playwright
  26. key: ${{ runner.os }}-pw-chromium-${{ hashFiles('**/*.csproj') }}
  27. restore-keys: |
  28. ${{ runner.os }}-pw-chromium-
  29. - name: Restore
  30. run: dotnet restore
  31. - name: Build
  32. run: dotnet build --no-restore --configuration Release
  33. # Prefer the Playwright script that comes with the NuGet package (no global tool install)
  34. - name: Install Playwright Browsers (Chromium only)
  35. shell: bash
  36. run: |
  37. pwsh Tests.E2e/bin/Release/net*/playwright.ps1 install --with-deps chromium
  38. - name: Build Docker Image
  39. run: |
  40. docker build \
  41. -t rackpeek:ci \
  42. -f RackPeek.Web/Dockerfile \
  43. .
  44. - name: Run E2E Tests
  45. run: dotnet test Tests.E2e --configuration Release --verbosity normal