# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js CI permissions: contents: read on: push: branches: [ main, master, beta, Release2.7, release-3.0 ] pull_request: branches: [ main, master, beta, Release2.7, release-3.0 ] merge_group: branches: [ "main", "master", "beta", "Release*", "release*", "*-legacy", "legacy-v1" ] jobs: build: runs-on: ubuntu-latest # The puppeteer browser download into the shared ~/.cache/puppeteer was racing # across the many npm/rush install steps and intermittently failed extraction # ("browser folder exists but the executable is missing"), breaking installs. # Skip the puppeteer browser download entirely and run the QUnit tests against # the runner's pre-installed Chrome (see the "pre-installed Chrome" step below). env: PUPPETEER_SKIP_DOWNLOAD: 'true' strategy: matrix: node-version: [ '>=22.23.4 <23', '>=24.22.1 <25', '>=26.12.1 <27' ] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Test CDN publishing and activation routing shell: pwsh run: .\common\publish\Tests\CdnPublishing.tests.ps1 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: ${{ matrix.node-version }} check-latest: true - name: Update rush shrinkwrap dependencies (for different node versions) run: node common/scripts/install-run-rush.js update --full --recheck - run: npm install rollup -g - run: npm install grunt-cli - run: npm install - run: node common/scripts/install-run-rush.js check - run: node common/scripts/install-run-rush.js update --full --recheck - name: Use the runner's pre-installed Chrome for Puppeteer run: | CHROME_BIN="${CHROME_BIN:-$(command -v google-chrome || command -v google-chrome-stable || command -v chromium-browser || command -v chromium)}" if [ -z "$CHROME_BIN" ]; then echo "No system Chrome/Chromium found on the runner" >&2 exit 1 fi echo "Using Chrome at: $CHROME_BIN" "$CHROME_BIN" --version || true echo "PUPPETEER_EXECUTABLE_PATH=$CHROME_BIN" >> "$GITHUB_ENV" - run: npm run build --verbose timeout-minutes: 20 - run: npm run test --verbose timeout-minutes: 30