test.yml 2.5 KB

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