feat(surveys): add back button option to the survey editor #40374
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow runs the tests for the LLM Gateway service | |
| # (services/llm-gateway/). It lives outside the Backend CI workflow because | |
| # the service has no runtime dependencies on the PostHog Django backend — it | |
| # only needs Python + uv + pytest. | |
| # | |
| # The `llm_services_tests` roll-up is what gets marked as a required check | |
| # in branch protection: new LLM-service test jobs can be added to its `needs` | |
| # array without reconfiguring required checks in the GitHub UI. | |
| name: LLM Services CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| name: Determine need to run LLM Services checks | |
| outputs: | |
| llm_gateway: ${{ steps.filter.outputs.llm_gateway || 'true' }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 | |
| id: app-token | |
| if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | |
| with: | |
| client-id: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_POSTHOG_PATHS_FILTER_PRIVATE_KEY }} | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| if: github.event_name != 'push' # Run all tests on master push | |
| with: | |
| token: ${{ steps.app-token.outputs.token || github.token }} | |
| filters: | | |
| llm_gateway: | |
| - 'services/llm-gateway/**' | |
| - '.github/workflows/ci-llm-gateway.yml' | |
| llm-gateway: | |
| name: LLM Gateway Tests | |
| needs: changes | |
| if: needs.changes.outputs.llm_gateway == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| defaults: | |
| run: | |
| working-directory: services/llm-gateway | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: '3.13.13' | |
| token: ${{ github.token }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| version: '0.11.14' # pinned: unpinned setup-uv calls GH API on every job, exhausts rate limit | |
| - name: Install dependencies | |
| run: uv sync --frozen --dev | |
| - name: Run tests | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }} | |
| run: uv run pytest tests/ -v --tb=short --junitxml=junit.xml | |
| - name: Upload test results | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| if: always() | |
| with: | |
| name: junit-results-llm-gateway | |
| path: services/llm-gateway/junit.xml | |
| # Single required status check for branch protection. Add future LLM | |
| # services test jobs to `needs` here rather than reconfiguring GitHub. | |
| llm_services_tests: | |
| needs: [changes, llm-gateway] | |
| name: LLM Services Tests Pass | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| if: ${{ !cancelled() }} | |
| steps: | |
| - name: Check outcomes | |
| run: | | |
| if [[ "${{ needs.changes.result }}" == "failure" ]]; then | |
| echo "Change detection job failed." | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.llm-gateway.result }}" == "failure" ]]; then | |
| echo "LLM Gateway tests failed." | |
| exit 1 | |
| fi | |
| echo "All LLM Services checks passed." |