test.yml 2.3 KB

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