Skip to content

Add diagnostic timing logs to content script #13

Add diagnostic timing logs to content script

Add diagnostic timing logs to content script #13

Workflow file for this run

name: Test
on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Log environment versions
run: |
echo "OS: ${{ matrix.os }}"
echo "Node: $(node --version)"
- name: Install dependencies
run: npm ci
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ${{ matrix.os == 'macos-latest' && '~/Library/Caches/ms-playwright' || (matrix.os == 'windows-latest' && '~/AppData/Local/ms-playwright' || '~/.cache/ms-playwright') }}
key: playwright-${{ matrix.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install chromium --with-deps
- name: Install Playwright dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Build Chrome extension
run: npm run build:chrome
- name: Run tests
run: npm test
env:
API_CONTRACT_TEST_PAT: ${{ secrets.API_CONTRACT_TEST_PAT }}
- name: Upload Chrome extension
uses: actions/upload-artifact@v4
with:
name: chrome-extension-${{ matrix.os }}
path: build/bundle/*.zip
retention-days: 7
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.os }}
path: playwright-report/
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
path: test-results/
retention-days: 7
if-no-files-found: ignore
lint:
runs-on: macos-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build Firefox extension
run: npm run build:firefox
- name: Lint extension
run: npm run lint
- name: Upload Firefox extension
uses: actions/upload-artifact@v4
with:
name: firefox-extension
path: build/bundle/*.xpi
retention-days: 7