fix(core): propagate color env to worker processes for correct ANSI output #3530
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: Test | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| schedule: | |
| - cron: '0 16 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| # Configure Node.js memory limit to 6GB (default GitHub Actions limit is 7GB) | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.changes.outputs.changed }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: changes | |
| with: | |
| predicate-quantifier: 'every' | |
| filters: | | |
| changed: | |
| - "!**/*.md" | |
| - "!**/*.mdx" | |
| - "!**/_meta.json" | |
| - "!**/dictionary.txt" | |
| # ======== ut ======== | |
| ut: | |
| needs: prepare | |
| if: needs.prepare.outputs.changed == 'true' || github.event_name == 'schedule' | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| # run ut in macOS, as SWC cases will fail in Ubuntu CI | |
| os: [macos-14, windows-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: pnpm fetch | |
| run: pnpm fetch | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Set Playwright cache path | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" = "Windows" ]; then | |
| echo "PLAYWRIGHT_BROWSERS_PATH=$USERPROFILE/AppData/Local/ms-playwright" >> "$GITHUB_ENV" | |
| else | |
| echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/Library/Caches/ms-playwright" >> "$GITHUB_ENV" | |
| fi | |
| - name: Cache Playwright Browsers | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | |
| key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install Playwright Browsers | |
| run: npx playwright install chromium webkit | |
| - name: Run Type Check | |
| run: pnpm run typecheck | |
| - name: Run Test | |
| run: pnpm run test | |
| - name: Run Examples Test | |
| run: pnpm run test:examples | |
| # ======== e2e ======== | |
| e2e: | |
| needs: [prepare, ut] | |
| if: needs.prepare.outputs.changed == 'true' || github.event_name == 'schedule' | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # run ut in macOS, as SWC cases will fail in Ubuntu CI | |
| os: [macos-14, windows-latest] | |
| node_version: ${{ fromJson(github.event_name == 'schedule' && '["20","22","24"]' || '["20","24"]') }} | |
| test_script: ['test', 'test:commonjs', 'test:no-isolate'] | |
| exclude: | |
| # Node 20 is flaky here because reused no-isolate workers can hit upstream vm native crashes. | |
| - node_version: '20' | |
| test_script: 'test:no-isolate' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | |
| - name: Setup Node.js ${{ matrix.node_version }} | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: ${{ matrix.node_version }} | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: pnpm fetch | |
| run: pnpm fetch | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Set Playwright cache path | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" = "Windows" ]; then | |
| echo "PLAYWRIGHT_BROWSERS_PATH=$USERPROFILE/AppData/Local/ms-playwright" >> "$GITHUB_ENV" | |
| else | |
| echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/Library/Caches/ms-playwright" >> "$GITHUB_ENV" | |
| fi | |
| - name: Cache Playwright Browsers | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | |
| key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install Playwright Browsers | |
| run: npx playwright install chromium webkit | |
| - name: E2E Test (${{ matrix.test_script }}) | |
| run: cd e2e && pnpm ${{ matrix.test_script }} | |
| - name: VS Code Extension Test | |
| if: matrix.test_script == 'test' | |
| run: pnpm run test:vscode | |
| # ======== gate ======== | |
| test-gate: | |
| needs: [prepare, ut, e2e] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check test requirement | |
| run: | | |
| if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ needs.prepare.outputs.changed }}" = "true" ]; then | |
| [ "${{ needs.ut.result }}" = "success" ] && [ "${{ needs.e2e.result }}" = "success" ] | |
| fi |