Merge pull request #11429 from gitbutlerapp/copilot/port-async-openai… #11068
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
| name: E2E Tests Playwright | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| inputs: | |
| sha: | |
| type: string | |
| required: false | |
| description: Target SHA | |
| jobs: | |
| test: | |
| name: e2e-playwright | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/gitbutlerapp/ci-base-image:latest | |
| timeout-minutes: 60 | |
| env: | |
| DESKTOP_PORT: 3000 | |
| BUTLER_PORT: 6978 | |
| VITE_E2E: 'true' | |
| VITE_BUTLER_PORT: 6978 | |
| VITE_BUTLER_HOST: 'localhost' | |
| VITE_BUILD_TARGET: 'web' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| if: ${{ github.event_name != 'workflow_dispatch' }} | |
| - uses: actions/checkout@v6 | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| with: | |
| persist-credentials: false | |
| ref: ${{ github.event.inputs.sha }} | |
| - name: Rust Cache | |
| uses: Swatinem/[email protected] | |
| with: | |
| shared-key: e2e-playwright-rust-binaries | |
| save-if: ${{ github.ref == 'refs/heads/master' }} | |
| - name: Preset Git Configuration and but-testing location | |
| run: | | |
| echo "GIT_CONFIG_GLOBAL=$PWD/e2e/playwright/fixtures/.gitconfig" >> $GITHUB_ENV | |
| echo BUT_TESTING=$PWD/target/debug/but-testing >> $GITHUB_ENV | |
| - name: Setup node environment | |
| uses: ./.github/actions/init-env-node | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| - id: get_playwright_version | |
| uses: eviden-actions/get-playwright-version@v1 | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| - name: Cache playwright binaries | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: | | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-${{ steps.get_playwright_version.outputs.playwright-version }} | |
| - run: cd e2e && pnpm exec playwright install --with-deps | |
| if: ${{ steps.playwright-cache.outputs.cache-hit != 'true' && github.ref != 'refs/heads/master' }} | |
| - run: apt install -y libnss3 | |
| if: ${{ steps.playwright-cache.outputs.cache-hit == 'true' && github.ref != 'refs/heads/master' }} | |
| name: Install missing deps after cache hit | |
| - name: Build gitbutler-git | |
| run: cargo build -p gitbutler-git | |
| - name: Build but-server | |
| run: cargo build -p but-server | |
| - name: Build but-testing | |
| run: cargo build -p but-testing | |
| - name: Build SvelteKit | |
| run: pnpm build:desktop | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| - name: Run Playwright tests | |
| run: pnpm exec turbo run test:e2e:playwright | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| - uses: actions/upload-artifact@v5 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: | | |
| ./e2e/playwright-report/ | |
| ./e2e/test-results/ | |
| retention-days: 30 |