fix(services): clear SfProject instance cache on project file change … #241
Workflow file for this run
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: Apex LSP E2E (Playwright) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| vscode_version: | |
| description: 'VS Code version for E2E (e.g. 1.116.0). Empty uses repo variable | |
| PLAYWRIGHT_VSCODE_VERSION.' | |
| required: false | |
| type: string | |
| default: '' | |
| workflow_call: | |
| inputs: | |
| vscode_version: | |
| description: 'VS Code version for E2E (e.g. 1.116.0). Empty uses repo variable | |
| PLAYWRIGHT_VSCODE_VERSION.' | |
| required: false | |
| type: string | |
| default: '' | |
| push: | |
| branches-ignore: [ main, develop ] | |
| paths-ignore: | |
| - '.claude/**' | |
| - '.cursor/**' | |
| - 'contributing/**' | |
| - 'CONTRIBUTING.md' | |
| - 'docs/**' | |
| - '**/README*' | |
| - 'SECURITY*' | |
| - 'CODE_OF_CONDUCT*' | |
| - 'CHANGELOG*' | |
| - '**/CHANGELOG*' | |
| concurrency: | |
| group: ci-${{ github.ref }}-apexLspE2E | |
| cancel-in-progress: true | |
| jobs: | |
| e2e-desktop: | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| strategy: | |
| matrix: | |
| os: [ macos-latest, ubuntu-latest, windows-latest ] | |
| include: | |
| - os: ubuntu-latest | |
| test_runner_prefix: 'xvfb-run -a ' | |
| fail-fast: false | |
| env: | |
| VSCODE_DESKTOP: 1 | |
| E2E_FROM_VSIX: 1 | |
| PLAYWRIGHT_VSCODE_VERSION: ${{ github.event_name != 'push' && | |
| inputs.vscode_version != '' && inputs.vscode_version || | |
| vars.PLAYWRIGHT_VSCODE_VERSION }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Log desktop VS Code version | |
| shell: bash | |
| run: echo "::notice::VS Code version=${PLAYWRIGHT_VSCODE_VERSION}" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - uses: google/wireit@setup-github-actions-caching/v2 | |
| - name: Install dependencies | |
| uses: salesforcecli/github-workflows/.github/actions/npmInstallWithRetries@main | |
| # Try E2E tests first. On wireit cache hit, the command is skipped — we never need Playwright browsers. | |
| # E2E_NO_RETRIES=1 disables Playwright retries in config so failures are fast on a cache miss. | |
| - name: Try E2E tests | |
| id: try-run | |
| continue-on-error: true | |
| timeout-minutes: 5 | |
| env: | |
| CI: 1 | |
| VSCODE_DESKTOP: 1 | |
| E2E_NO_RETRIES: 1 | |
| run: ${{ matrix.test_runner_prefix }}npm run test:desktop -w salesforcedx-vscode-apex -- --reporter=html | |
| # Only install Playwright on cache miss. apex LSP specs do not exercise an org, so no CLI/scratch-org setup is required. | |
| - name: Install Playwright browsers and OS deps | |
| if: steps.try-run.outcome == 'failure' | |
| uses: salesforcecli/github-workflows/.github/actions/retry@main | |
| with: | |
| max_attempts: 3 | |
| command: npx playwright install chromium --with-deps | |
| retry_wait_seconds: 60 | |
| - name: Run Apex LSP E2E tests (parallel) | |
| if: steps.try-run.outcome == 'failure' | |
| id: parallel-run | |
| continue-on-error: true | |
| env: | |
| CI: 1 | |
| VSCODE_DESKTOP: 1 | |
| run: ${{ matrix.test_runner_prefix }}npm run test:desktop -w salesforcedx-vscode-apex -- --reporter=html | |
| - name: Retry failed tests (sequential) | |
| if: steps.try-run.outcome == 'failure' && steps.parallel-run.outcome == | |
| 'failure' | |
| env: | |
| CI: 1 | |
| VSCODE_DESKTOP: 1 | |
| run: ${{ matrix.test_runner_prefix }}npm run test:desktop -w salesforcedx-vscode-apex -- --last-failed --reporter=html | |
| - name: Copy span files to test-results | |
| if: always() | |
| shell: bash | |
| run: | | |
| mkdir -p packages/salesforcedx-vscode-apex/test-results/spans | |
| cp -r ~/.sf/vscode-spans/. packages/salesforcedx-vscode-apex/test-results/spans/ 2>/dev/null || true | |
| - name: Upload Playwright HTML report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report-apex-desktop-${{ matrix.os }} | |
| path: packages/salesforcedx-vscode-apex/playwright-report | |
| if-no-files-found: ignore | |
| - name: Upload Playwright Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-test-results-apex-desktop-${{ matrix.os }} | |
| path: packages/salesforcedx-vscode-apex/test-results | |
| if-no-files-found: ignore | |