test.yml 2.6 KB

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