test.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. name: test
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. pull_request:
  7. workflow_dispatch:
  8. concurrency:
  9. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  10. cancel-in-progress: true
  11. permissions:
  12. contents: read
  13. jobs:
  14. unit:
  15. name: unit (${{ matrix.settings.name }})
  16. strategy:
  17. fail-fast: false
  18. matrix:
  19. settings:
  20. - name: linux
  21. host: blacksmith-4vcpu-ubuntu-2404
  22. - name: windows
  23. host: blacksmith-4vcpu-windows-2025
  24. runs-on: ${{ matrix.settings.host }}
  25. defaults:
  26. run:
  27. shell: bash
  28. steps:
  29. - name: Checkout repository
  30. uses: actions/checkout@v4
  31. with:
  32. token: ${{ secrets.GITHUB_TOKEN }}
  33. - name: Setup Bun
  34. uses: ./.github/actions/setup-bun
  35. - name: Configure git identity
  36. run: |
  37. git config --global user.email "[email protected]"
  38. git config --global user.name "opencode"
  39. - name: Run unit tests
  40. run: bun turbo test
  41. e2e:
  42. name: e2e (${{ matrix.settings.name }})
  43. needs: unit
  44. strategy:
  45. fail-fast: false
  46. matrix:
  47. settings:
  48. - name: linux
  49. host: blacksmith-4vcpu-ubuntu-2404
  50. playwright: bunx playwright install --with-deps
  51. - name: windows
  52. host: blacksmith-4vcpu-windows-2025
  53. playwright: bunx playwright install
  54. runs-on: ${{ matrix.settings.host }}
  55. env:
  56. PLAYWRIGHT_BROWSERS_PATH: 0
  57. defaults:
  58. run:
  59. shell: bash
  60. steps:
  61. - name: Checkout repository
  62. uses: actions/checkout@v4
  63. with:
  64. token: ${{ secrets.GITHUB_TOKEN }}
  65. - name: Setup Bun
  66. uses: ./.github/actions/setup-bun
  67. - name: Install Playwright browsers
  68. working-directory: packages/app
  69. run: ${{ matrix.settings.playwright }}
  70. - name: Run app e2e tests
  71. run: bun --cwd packages/app test:e2e:local
  72. env:
  73. CI: true
  74. timeout-minutes: 30
  75. - name: Upload Playwright artifacts
  76. if: failure()
  77. uses: actions/upload-artifact@v4
  78. with:
  79. name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }}
  80. if-no-files-found: ignore
  81. retention-days: 7
  82. path: |
  83. packages/app/e2e/test-results
  84. packages/app/e2e/playwright-report