Next Release: changelog and version packages #2406
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'renovate/**' | |
| - 'release/**' | |
| pull_request: | |
| branches: | |
| - main | |
| - 'release/**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| actions: read | |
| checks: write | |
| env: | |
| SFCC_DISABLE_TELEMETRY: ${{ vars.SFCC_DISABLE_TELEMETRY }} | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [22.x, 24.x, 26.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm -r run build | |
| - name: Run SDK tests | |
| id: sdk-test | |
| working-directory: packages/b2c-tooling-sdk | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run MCP tests | |
| id: mcp-test | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| working-directory: packages/b2c-dx-mcp | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run CLI tests | |
| id: cli-test | |
| if: always() && steps.mcp-test.conclusion != 'cancelled' | |
| working-directory: packages/b2c-cli | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run MRT Utilities tests | |
| id: mrt-test | |
| if: always() && steps.cli-test.conclusion != 'cancelled' | |
| working-directory: packages/mrt-utilities | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run MRT Reference App tests | |
| id: mrt-reference-app-test | |
| if: always() && steps.mrt-test.conclusion != 'cancelled' | |
| working-directory: packages/mrt-reference-app | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run MRT Welcome App tests | |
| id: mrt-welcome-app-test | |
| if: always() && steps.mrt-reference-app-test.conclusion != 'cancelled' | |
| working-directory: packages/mrt-welcome-app | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run VS Extension checks | |
| id: vs-extension-test | |
| if: always() && steps.mrt-welcome-app-test.conclusion != 'cancelled' | |
| working-directory: packages/b2c-vs-extension | |
| run: pnpm run typecheck:agent && pnpm run lint | |
| - name: Test Report | |
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| with: | |
| name: Test Results (Node ${{ matrix.node-version }}) | |
| path: 'packages/*/test-results.json' | |
| reporter: mocha-json | |
| - name: Generate coverage summary | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| run: | | |
| echo "## Coverage (Node ${{ matrix.node-version }})" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # SDK Coverage | |
| if [ -f "packages/b2c-tooling-sdk/coverage/lcov.info" ]; then | |
| echo "### @salesforce/b2c-tooling-sdk" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cd packages/b2c-tooling-sdk && pnpm c8 report --reporter=text-summary 2>/dev/null | tail -n 6 >> $GITHUB_STEP_SUMMARY | |
| cd ../.. | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # CLI Coverage | |
| if [ -f "packages/b2c-cli/coverage/lcov.info" ]; then | |
| echo "### @salesforce/b2c-cli" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| cd packages/b2c-cli && pnpm c8 report --reporter=text-summary 2>/dev/null | tail -n 6 >> $GITHUB_STEP_SUMMARY | |
| cd ../.. | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload coverage reports | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-reports-node-${{ matrix.node-version }} | |
| path: | | |
| packages/b2c-tooling-sdk/coverage/ | |
| packages/b2c-cli/coverage/ | |
| retention-days: 30 | |
| test-windows: | |
| runs-on: windows-latest | |
| # Advisory rollout: Windows coverage is new; surface failures without | |
| # blocking Linux CI while remaining Windows-specific test issues are | |
| # addressed in follow-up PRs. Remove once Windows tests are green. | |
| continue-on-error: true | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Node 24 pinned to 24.15.0 on Windows: 24.16.0 ships a libuv update | |
| # that aborts with `Assertion failed: !_wcsnicmp(filename, dir, dirlen)` | |
| # in src/win/fs-event.c during chokidar's recursive watch tests. | |
| # Revisit when upstream Node ships a fix. | |
| # | |
| # Node 26 is intentionally absent from the Windows matrix: every 26.x | |
| # release ships the same broken libuv (1.52.1) and aborts with that | |
| # fs-event.c assertion during chokidar's recursive watch tests, so | |
| # there is no 26.x to pin to (unlike 24, where 24.15.0 is safe). Node | |
| # 26 is exercised on the Linux matrix above; add it back here once | |
| # upstream libuv ships a fix. | |
| node-version: [22.x, 24.15.0] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Windows machine | |
| uses: ./.github/actions/setup-windows | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Build packages | |
| run: pnpm -r run build | |
| - name: Run SDK tests | |
| id: sdk-test | |
| working-directory: packages/b2c-tooling-sdk | |
| # Windows-specific script (test:ci:win) bypasses c8's coverage | |
| # threshold check. Under the tsx ESM loader, V8 coverage on Windows | |
| # mis-attributes TS source files (distinct file:// URL casing/format | |
| # vs. the Linux paths c8 remaps against), so reported coverage is | |
| # unreliable on Windows even though the tests pass. Thresholds are | |
| # enforced on Linux, where the numbers are accurate; coverage is still | |
| # generated and uploaded on Windows for inspection. | |
| run: pnpm run pretest && pnpm run test:ci:win && pnpm run lint | |
| - name: Run MCP tests | |
| id: mcp-test | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| working-directory: packages/b2c-dx-mcp | |
| # See the SDK step above: test:ci:win bypasses the coverage gate on | |
| # Windows (unreliable V8 attribution under the tsx loader). | |
| run: pnpm run pretest && pnpm run test:ci:win && pnpm run lint | |
| - name: Run CLI tests | |
| id: cli-test | |
| if: always() && steps.mcp-test.conclusion != 'cancelled' | |
| working-directory: packages/b2c-cli | |
| # See the SDK step above: test:ci:win bypasses the coverage gate on | |
| # Windows (unreliable V8 attribution under the tsx loader). | |
| run: pnpm run pretest && pnpm run test:ci:win && pnpm run lint | |
| - name: Run MRT Utilities tests | |
| id: mrt-test | |
| if: always() && steps.cli-test.conclusion != 'cancelled' | |
| working-directory: packages/mrt-utilities | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run MRT Reference App tests | |
| id: mrt-reference-app-test | |
| if: always() && steps.mrt-test.conclusion != 'cancelled' | |
| working-directory: packages/mrt-reference-app | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run MRT Welcome App tests | |
| id: mrt-welcome-app-test | |
| if: always() && steps.mrt-reference-app-test.conclusion != 'cancelled' | |
| working-directory: packages/mrt-welcome-app | |
| run: pnpm run pretest && pnpm run test:ci && pnpm run lint | |
| - name: Run VS Extension checks | |
| if: always() && steps.mrt-welcome-app-test.conclusion != 'cancelled' | |
| working-directory: packages/b2c-vs-extension | |
| run: pnpm run typecheck:agent && pnpm run lint | |
| - name: Print Windows test failures | |
| # Mocha's JSON reporter swallows stdout, so Windows-only failures are | |
| # invisible in the step log. Parse the per-package test-results.json | |
| # and echo failing test titles + error messages to the job log for triage. | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| shell: bash | |
| run: | | |
| node -e " | |
| const fs = require('node:fs'); | |
| const path = require('node:path'); | |
| const reports = [ | |
| 'packages/b2c-tooling-sdk/test-results.json', | |
| 'packages/b2c-dx-mcp/test-results.json', | |
| 'packages/b2c-cli/test-results.json', | |
| 'packages/mrt-utilities/test-results.json', | |
| 'packages/mrt-reference-app/test-results.json', | |
| 'packages/mrt-welcome-app/test-results.json', | |
| ]; | |
| let totalFailures = 0; | |
| for (const report of reports) { | |
| if (!fs.existsSync(report)) continue; | |
| const data = JSON.parse(fs.readFileSync(report, 'utf8')); | |
| const failures = data.failures || []; | |
| if (failures.length === 0) continue; | |
| totalFailures += failures.length; | |
| console.log('\n=== ' + report + ' (' + failures.length + ' failures) ==='); | |
| for (const f of failures) { | |
| console.log('\n✖ ' + f.fullTitle); | |
| if (f.err && f.err.message) console.log(' message: ' + f.err.message.split('\n')[0]); | |
| if (f.err && f.err.stack) console.log(' stack: ' + f.err.stack.split('\n').slice(0, 5).join('\n ')); | |
| } | |
| } | |
| if (totalFailures === 0) console.log('No Windows test failures reported.'); | |
| else console.log('\nTotal Windows failures: ' + totalFailures); | |
| " | |
| - name: Test Report | |
| uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0 | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| with: | |
| name: Test Results (Windows Node ${{ matrix.node-version }}) | |
| path: 'packages/*/test-results.json' | |
| reporter: mocha-json | |
| - name: Upload test results (for Windows triage) | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: test-results-windows-node-${{ matrix.node-version }} | |
| path: 'packages/*/test-results.json' | |
| retention-days: 30 | |
| - name: Upload coverage reports | |
| if: always() && steps.sdk-test.conclusion != 'cancelled' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-reports-windows-node-${{ matrix.node-version }} | |
| path: | | |
| packages/b2c-tooling-sdk/coverage/ | |
| packages/b2c-cli/coverage/ | |
| retention-days: 30 |