test.yml 3.6 KB

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