Skip to content

Improve CI test visibility and upload build artifacts #2

Improve CI test visibility and upload build artifacts

Improve CI test visibility and upload build artifacts #2

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:
runs-on: macos-latest
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 "macOS: $(sw_vers -productVersion)"
echo "Node: $(node --version)"
echo "Chrome: $(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version)"
echo "Firefox: $(/Applications/Firefox.app/Contents/MacOS/firefox --version)"
- name: Install dependencies
run: npm ci
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/Library/Caches/ms-playwright
key: playwright-${{ runner.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 -- --reporter=list
- name: Upload Chrome extension
uses: actions/upload-artifact@v4
with:
name: chrome-extension
path: build/bundle/*.zip
retention-days: 7
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
retention-days: 7
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