Condition Blocks to support minSupportedVersion #9581
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
deployments: write | |
jobs: | |
unit: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm ci | |
- run: npm run build | |
- run: npm run lint | |
- run: npm run stylelint | |
- run: npm run test-unit | |
- name: 'Clean tree' | |
run: 'npm run test-clean-tree' | |
integration: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: | | |
npm install | |
npm run build | |
- name: Cache docs output | |
id: docs-output | |
uses: actions/cache@v4 | |
with: | |
path: docs | |
key: docs-output-${{ github.run_id }} | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- run: npm run test-int-x | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report-pages | |
path: special-pages/playwright-report | |
retention-days: 5 | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report-injected | |
path: injected/playwright-report | |
retention-days: 5 | |
- name: Build docs | |
run: npm run docs | |
deploy-docs: | |
runs-on: ubuntu-latest | |
needs: integration | |
if: ${{ github.ref == 'refs/heads/main' }} | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Cache build outputs | |
id: docs-output | |
uses: actions/cache@v4 | |
with: | |
path: docs | |
key: docs-output-${{ github.run_id }} | |
- name: Setup Github Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# This job ensures all runtime dependencies for the injected/ subproject are correctly listed in 'dependencies' (not 'devDependencies') | |
# by running the build with only production dependencies installed in injected/. It will fail if any required dependency is missing. | |
production-deps: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install production dependencies only (injected/) | |
run: npm ci --production | |
- name: Build with production dependencies (injected/) | |
run: cd injected && npm run build | |
- name: Simulate extension esbuild for GPC feature (production deps only) | |
run: npx esbuild injected/src/features/gpc.js --bundle --outfile=/tmp/gpc-bundle.js |