test.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: test
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. pull_request:
  7. workflow_dispatch:
  8. concurrency:
  9. # Keep every run on dev so cancelled checks do not pollute the default branch
  10. # commit history. PRs and other branches still share a group and cancel stale runs.
  11. group: ${{ case(github.ref == 'refs/heads/dev', format('{0}-{1}', github.workflow, github.run_id), format('{0}-{1}', github.workflow, github.event.pull_request.number || github.ref)) }}
  12. cancel-in-progress: true
  13. permissions:
  14. contents: read
  15. jobs:
  16. unit:
  17. name: unit (${{ matrix.settings.name }})
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. settings:
  22. - name: linux
  23. host: blacksmith-4vcpu-ubuntu-2404
  24. - name: windows
  25. host: blacksmith-4vcpu-windows-2025
  26. runs-on: ${{ matrix.settings.host }}
  27. defaults:
  28. run:
  29. shell: bash
  30. steps:
  31. - name: Checkout repository
  32. uses: actions/checkout@v4
  33. with:
  34. token: ${{ secrets.GITHUB_TOKEN }}
  35. - name: Setup Bun
  36. uses: ./.github/actions/setup-bun
  37. - name: Configure git identity
  38. run: |
  39. git config --global user.email "[email protected]"
  40. git config --global user.name "opencode"
  41. - name: Run unit tests
  42. run: bun turbo test
  43. e2e:
  44. name: e2e (${{ matrix.settings.name }})
  45. needs: unit
  46. strategy:
  47. fail-fast: false
  48. matrix:
  49. settings:
  50. - name: linux
  51. host: blacksmith-4vcpu-ubuntu-2404
  52. playwright: bunx playwright install --with-deps
  53. - name: windows
  54. host: blacksmith-4vcpu-windows-2025
  55. playwright: bunx playwright install
  56. runs-on: ${{ matrix.settings.host }}
  57. env:
  58. PLAYWRIGHT_BROWSERS_PATH: 0
  59. defaults:
  60. run:
  61. shell: bash
  62. steps:
  63. - name: Checkout repository
  64. uses: actions/checkout@v4
  65. with:
  66. token: ${{ secrets.GITHUB_TOKEN }}
  67. - name: Setup Bun
  68. uses: ./.github/actions/setup-bun
  69. - name: Install Playwright browsers
  70. working-directory: packages/app
  71. run: ${{ matrix.settings.playwright }}
  72. - name: Run app e2e tests
  73. run: bun --cwd packages/app test:e2e:local
  74. env:
  75. CI: true
  76. timeout-minutes: 30
  77. - name: Upload Playwright artifacts
  78. if: failure()
  79. uses: actions/upload-artifact@v4
  80. with:
  81. name: playwright-${{ matrix.settings.name }}-${{ github.run_attempt }}
  82. if-no-files-found: ignore
  83. retention-days: 7
  84. path: |
  85. packages/app/e2e/test-results
  86. packages/app/e2e/playwright-report