fix broken workflow #2
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: 'E2E Tests' | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| is_fork: | ||
| description: 'Whether this is running on a fork' | ||
| type: boolean | ||
| default: false | ||
| secrets: | ||
| CI_GITHUB_TOKEN: | ||
| required: true | ||
| GITHUB_TOKEN: | ||
| required: true | ||
| GH_ACTIONS_SSH_TEST_KEY_PEM: | ||
| required: false | ||
| GH_ACTIONS_SSH_TEST_DNS_NAME: | ||
| required: false | ||
| jobs: | ||
| vscode-get-test-file-matrix: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }} | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: ".nvmrc" | ||
| - name: Cache npm | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.npm | ||
| key: ${{ runner.os }}-npm-cache-matrix-${{ hashFiles('core/package-lock.json', 'extensions/vscode/package-lock.json') }} | ||
| - name: Cache packages node_modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| packages/*/node_modules | ||
| key: ${{ runner.os }}-packages-node-modules-${{ hashFiles('packages/*/package-lock.json') }} | ||
| - name: Cache core node modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: core/node_modules | ||
| key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} | ||
| - name: Cache vscode extension node modules | ||
| uses: actions/cache@v4 | ||
| id: vscode-cache | ||
| with: | ||
| path: extensions/vscode/node_modules | ||
| key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} | ||
| - name: Build packages and get test files | ||
| id: vscode-get-test-file-matrix | ||
| run: | | ||
| node ./scripts/build-packages.js | ||
| cd extensions/vscode | ||
| npm ci | ||
| npm run e2e:compile | ||
| if [[ "${{ inputs.is_fork }}" == "true" ]]; then | ||
| # Exclude SSH tests for forks | ||
| FILES=$(ls -1 e2e/_output/tests/*.test.js | grep -v "SSH" | jq -R . | jq -s .) | ||
| else | ||
| # Include all tests for non-forks | ||
| FILES=$(ls -1 e2e/_output/tests/*.test.js | jq -R . | jq -s .) | ||
| fi | ||
| echo "test_file_matrix<<EOF" >> $GITHUB_OUTPUT | ||
| echo "$FILES" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
| env: | ||
| # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 | ||
| GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} | ||
| - name: Debug Outputs | ||
| run: | | ||
| echo "Test files: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}" | ||
| vscode-package-extension-linux: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Build VS Code extension | ||
| uses: ./.github/actions/build-vscode-extension | ||
| with: | ||
| platform: linux | ||
| arch: x64 | ||
| npm_config_arch: x64 | ||
| pre-release: false | ||
| commit-sha: ${{ github.sha }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vscode-extension-build-Linux | ||
| path: extensions/vscode/build | ||
| vscode-e2e-tests: | ||
| name: ${{ matrix.test_file || 'unknown' }} (${{ matrix.command }}) | ||
| needs: [vscode-get-test-file-matrix, vscode-package-extension-linux] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }} | ||
| command: ["e2e:ci:run", "e2e:ci:run-yaml"] | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Run VS Code E2E test | ||
| uses: ./.github/actions/run-vscode-e2e-test | ||
| with: | ||
| test_file: ${{ matrix.test_file }} | ||
| command: ${{ matrix.command }} | ||
| ssh_key: ${{ secrets.GH_ACTIONS_SSH_TEST_KEY_PEM }} | ||
| ssh_host: ${{ secrets.GH_ACTIONS_SSH_TEST_DNS_NAME }} | ||
| is_fork: ${{ inputs.is_fork }} | ||