test.yml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. name: test
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. pull_request:
  7. workflow_dispatch:
  8. jobs:
  9. test:
  10. runs-on: blacksmith-4vcpu-ubuntu-2404
  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: Install Playwright browsers
  19. working-directory: packages/app
  20. run: bunx playwright install --with-deps
  21. - name: Seed opencode data
  22. run: bun --cwd packages/opencode script/seed-e2e.ts
  23. env:
  24. MODELS_DEV_API_JSON: ${{ github.workspace }}/packages/opencode/test/tool/fixtures/models-api.json
  25. OPENCODE_DISABLE_MODELS_FETCH: "true"
  26. OPENCODE_DISABLE_SHARE: "true"
  27. OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
  28. OPENCODE_DISABLE_DEFAULT_PLUGINS: "true"
  29. OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true"
  30. OPENCODE_TEST_HOME: ${{ runner.temp }}/opencode-e2e/home
  31. XDG_DATA_HOME: ${{ runner.temp }}/opencode-e2e/share
  32. XDG_CACHE_HOME: ${{ runner.temp }}/opencode-e2e/cache
  33. XDG_CONFIG_HOME: ${{ runner.temp }}/opencode-e2e/config
  34. XDG_STATE_HOME: ${{ runner.temp }}/opencode-e2e/state
  35. OPENCODE_E2E_PROJECT_DIR: ${{ github.workspace }}
  36. OPENCODE_E2E_SESSION_TITLE: "E2E Session"
  37. OPENCODE_E2E_MESSAGE: "Seeded for UI e2e"
  38. OPENCODE_E2E_MODEL: "opencode/gpt-5-nano"
  39. - name: Run opencode server
  40. run: bun --cwd packages/opencode run dev -- --print-logs --log-level WARN serve --port 4096 --hostname 0.0.0.0 &
  41. env:
  42. MODELS_DEV_API_JSON: ${{ github.workspace }}/packages/opencode/test/tool/fixtures/models-api.json
  43. OPENCODE_DISABLE_MODELS_FETCH: "true"
  44. OPENCODE_DISABLE_SHARE: "true"
  45. OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
  46. OPENCODE_DISABLE_DEFAULT_PLUGINS: "true"
  47. OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true"
  48. OPENCODE_TEST_HOME: ${{ runner.temp }}/opencode-e2e/home
  49. XDG_DATA_HOME: ${{ runner.temp }}/opencode-e2e/share
  50. XDG_CACHE_HOME: ${{ runner.temp }}/opencode-e2e/cache
  51. XDG_CONFIG_HOME: ${{ runner.temp }}/opencode-e2e/config
  52. XDG_STATE_HOME: ${{ runner.temp }}/opencode-e2e/state
  53. OPENCODE_CLIENT: "app"
  54. - name: Wait for opencode server
  55. run: |
  56. for i in {1..60}; do
  57. curl -fsS "http://localhost:4096/global/health" > /dev/null && exit 0
  58. sleep 1
  59. done
  60. exit 1
  61. - name: run
  62. run: |
  63. git config --global user.email "[email protected]"
  64. git config --global user.name "opencode"
  65. bun turbo typecheck
  66. bun turbo test
  67. env:
  68. CI: true
  69. MODELS_DEV_API_JSON: ${{ github.workspace }}/packages/opencode/test/tool/fixtures/models-api.json
  70. OPENCODE_DISABLE_MODELS_FETCH: "true"
  71. OPENCODE_DISABLE_SHARE: "true"
  72. OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
  73. OPENCODE_DISABLE_DEFAULT_PLUGINS: "true"
  74. OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: "true"
  75. OPENCODE_TEST_HOME: ${{ runner.temp }}/opencode-e2e/home
  76. XDG_DATA_HOME: ${{ runner.temp }}/opencode-e2e/share
  77. XDG_CACHE_HOME: ${{ runner.temp }}/opencode-e2e/cache
  78. XDG_CONFIG_HOME: ${{ runner.temp }}/opencode-e2e/config
  79. XDG_STATE_HOME: ${{ runner.temp }}/opencode-e2e/state
  80. PLAYWRIGHT_SERVER_HOST: "localhost"
  81. PLAYWRIGHT_SERVER_PORT: "4096"
  82. VITE_OPENCODE_SERVER_HOST: "localhost"
  83. VITE_OPENCODE_SERVER_PORT: "4096"
  84. OPENCODE_CLIENT: "app"
  85. timeout-minutes: 30