fix(MWPW-158561): adds aria-label to search icon #505
This file contains 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: Pull Request | |
on: | |
pull_request: | |
types: [opened, edited, synchronize, reopened] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: write-all | |
jobs: | |
check-pr-title: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
cache: 'npm' | |
- run: npm ci | |
- name: Check PR title | |
uses: JulienKode/pull-request-name-linter-action@v0.5.0 | |
with: | |
configuration-path: ./commitlint.config.js | |
check-test-requirements: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
- name: Install dependencies | |
run: npm install @actions/core @actions/github | |
- name: Check PR Type and Tests | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const script = require('./test-enforcement.js') | |
await script({github, context, core}) | |
check-linting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
cache: 'npm' | |
- name: Install | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
check-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
cache: 'npm' | |
- name: Install | |
run: npm ci | |
- name: Build | |
run: npm run build | |
run-unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
- name: Install | |
run: npm ci | |
- name: Coverage | |
run: npm run test:unit | |
check-coverage-thresholds: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
- name: Install | |
run: npm ci | |
- name: Coverage | |
run: npm run test:coverage | |
deployment: | |
needs: check-build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 | |
record-web-vitals: | |
runs-on: ubuntu-latest | |
needs: deployment | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
npm ci | |
npm install puppeteer web-vitals | |
- name: Install Chrome dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 | |
- name: Record Web Vitals | |
id: record-vitals | |
continue-on-error: true | |
run: | | |
xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node scripts/record-web-vitals.js | |
env: | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
PR_TITLE: ${{ github.event.pull_request.title }} | |
GITHUB_EVENT_NAME: 'pull_request' | |
GITHUB_EVENT_ACTION: 'closed' | |
GITHUB_PULL_REQUEST_MERGED: 'true' | |
- name: Create PR Comment | |
if: always() | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
let metrics; | |
try { | |
const fs = require('fs'); | |
metrics = JSON.parse(fs.readFileSync('.github/current-metrics.json', 'utf8')); | |
} catch (error) { | |
console.log('Error reading metrics file:', error); | |
metrics = { | |
date: new Date().toISOString(), | |
metrics: { | |
lcp: null, | |
fid: null, | |
cls: null | |
} | |
}; | |
} | |
const formatMetric = (value) => { | |
if (value === null) return 'N/A'; | |
return value.toFixed(2); | |
}; | |
const comment = `## Core Web Vitals Metrics | |
| Metric | Value | | |
|--------|-------| | |
| LCP | ${formatMetric(metrics.metrics?.lcp)} s | | |
| FID | ${formatMetric(metrics.metrics?.fid)} ms | | |
| CLS | ${formatMetric(metrics.metrics?.cls)} | | |
Recorded at: ${metrics.date} | |
PR: #${context.issue.number}`; | |
await github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: comment | |
}); | |
run-e2e-tests: | |
runs-on: ubuntu-latest | |
needs: deployment | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Chrome | |
uses: browser-actions/setup-chrome@v1 | |
with: | |
chrome-version: 'stable' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.13.1 | |
- name: Install | |
run: npm ci | |
- name: Install Matching ChromeDriver | |
run: | | |
CHROME_VERSION=$(google-chrome --version | cut -d' ' -f3 | cut -d'.' -f1) | |
npm install chromedriver@$CHROME_VERSION | |
- name: E2E | |
run: npm run test:e2e-prod | |
run-accessibility-checks: | |
runs-on: ubuntu-latest | |
needs: deployment | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18.0.0x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.0.0 | |
- name: Run pa11y | |
run: | | |
npm install -g pa11y@latest | |
pa11y https://adobecom.github.io/caas/ --timeout=10000 --threshold 20 --debug | |
run-lighthouse-checks: | |
runs-on: ubuntu-latest | |
needs: deployment | |
steps: | |
- uses: actions/checkout@master | |
- name: Lighthouse | |
uses: foo-software/lighthouse-check-action@master | |
id: lighthouseCheck | |
with: | |
urls: 'https://adobecom.github.io/caas/' | |
- name: Verify Lighthouse Check results | |
uses: foo-software/lighthouse-check-status-action@master | |
with: | |
lighthouseCheckResults: ${{ steps.lighthouseCheck.outputs.lighthouseCheckResults }} | |
minAccessibilityScore: "80" | |
minBestPracticesScore: "80" | |
minPerformanceScore: "30" | |
minProgressiveWebAppScore: "30" | |
minSeoScore: "70" | |