Skip to content

chore(deps-dev): bump electron from 40.4.1 to 40.6.0 #564

chore(deps-dev): bump electron from 40.4.1 to 40.6.0

chore(deps-dev): bump electron from 40.4.1 to 40.6.0 #564

Workflow file for this run

name: QA Matrix
on:
pull_request:
branches: ['main']
push:
branches: ['main']
workflow_dispatch:
permissions:
contents: read
jobs:
qa:
name: QA (${{ matrix.os }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact_os: linux
- os: windows-latest
artifact_os: windows
- os: macos-latest
artifact_os: macos
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Verify clean working tree after lint
run: git diff --name-status --exit-code
- name: Unit and integration tests
run: npm test -- --runInBand --ci --reporters=default --reporters=jest-junit
env:
JEST_JUNIT_OUTPUT_DIR: dist/test-results/${{ matrix.os }}
JEST_JUNIT_OUTPUT_NAME: junit.xml
- name: Upload unit test report artifact
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: unit-test-results-${{ matrix.os }}
path: dist/test-results/${{ matrix.os }}/junit.xml
if-no-files-found: warn
retention-days: 7
- name: Summarize stress benchmark metrics (Linux)
if: runner.os == 'Linux'
run: npm run stress:metrics
env:
PUSHGATEWAY_URL: ${{ secrets.PUSHGATEWAY_URL }}
PUSHGATEWAY_JOB: ai_code_fusion_stress
PUSHGATEWAY_INSTANCE: ${{ github.run_id }}-${{ github.run_attempt }}-${{ runner.os }}
PUSHGATEWAY_STRICT: ${{ vars.PUSHGATEWAY_STRICT || 'false' }}
- name: Build TypeScript
run: npm run build:ts
- name: Build CSS
run: npm run build:css
- name: Build renderer bundle
run: npm run build:webpack
- name: Install Playwright browser (Linux)
if: runner.os == 'Linux'
run: npx playwright install --with-deps chromium
- name: Install Playwright browser (Windows/macOS)
if: runner.os != 'Linux'
run: npx playwright install chromium
- name: Capture UI screenshot
id: capture_ui_screenshot
run: npm run qa:screenshot
env:
UI_SCREENSHOT_NAME: ui-${{ matrix.artifact_os }}.png
- name: Generate UI baseline manifest
id: generate_ui_baseline_manifest
if: steps.capture_ui_screenshot.outcome == 'success'
run: node scripts/generate-ui-baseline-manifest.js
env:
QA_ARTIFACT_OS: ${{ matrix.artifact_os }}
UI_SCREENSHOT_DIR: dist/qa/screenshots
UI_BASELINE_MANIFEST_PATH: dist/qa/baseline-manifest.json
- name: Run Electron E2E (Playwright)
if: runner.os == 'Linux'
run: xvfb-run -a npm run e2e:playwright:ci
- name: Upload UI screenshot
if: always() && steps.capture_ui_screenshot.outcome == 'success'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: ui-screenshot-${{ matrix.artifact_os }}
path: dist/qa/screenshots/*.png
if-no-files-found: error
retention-days: 60
- name: Upload UI baseline manifest
if: always() && steps.generate_ui_baseline_manifest.outcome == 'success'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: ui-screenshot-manifest-${{ matrix.artifact_os }}
path: dist/qa/baseline-manifest.json
if-no-files-found: error
retention-days: 60
- name: Upload Playwright E2E artifacts
if: runner.os == 'Linux' && always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: playwright-e2e-linux
path: |
dist/qa/playwright-report
dist/qa/playwright-results
if-no-files-found: warn
retention-days: 14
- name: Upload stress benchmark artifacts
if: runner.os == 'Linux' && always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: stress-benchmarks-linux
path: |
dist/benchmarks/*.json
dist/benchmarks/*.prom
if-no-files-found: error
retention-days: 14
resolve-ui-baseline:
name: Resolve UI Baseline
if: needs.qa.result == 'success' && ((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'push' && github.ref == 'refs/heads/main'))
needs: qa
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
outputs:
baseline_created_at: ${{ steps.select_baseline.outputs.baseline_created_at }}
baseline_head_sha: ${{ steps.select_baseline.outputs.baseline_head_sha }}
baseline_path: ${{ steps.export_baseline_path.outputs.baseline_path }}
baseline_run_id: ${{ steps.select_baseline.outputs.baseline_run_id }}
baseline_skip_reason: ${{ steps.select_baseline.outputs.baseline_skip_reason }}
baseline_status: ${{ steps.select_baseline.outputs.status }}
steps:
- name: Checkout repository metadata
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Resolve required baseline artifacts for this event
run: |
baseline_required_artifacts="ui-screenshot-linux,ui-screenshot-windows,ui-screenshot-macos,ui-screenshot-manifest-linux,ui-screenshot-manifest-windows,ui-screenshot-manifest-macos"
if [ "${{ github.event_name }}" = "pull_request" ]; then
baseline_required_artifacts="${baseline_required_artifacts},ui-baseline-promotion-ready"
fi
echo "BASELINE_REQUIRED_ARTIFACTS=${baseline_required_artifacts}" >> "${GITHUB_ENV}"
- name: Select baseline from previous successful main runs
id: select_baseline
run: node scripts/select-qa-baseline.js
env:
BASELINE_MAX_CANDIDATE_RUNS: 3
BASELINE_SELECTION_OUTPUT_PATH: dist/qa/baseline-selection.json
GITHUB_TOKEN: ${{ github.token }}
- name: Download baseline artifacts
if: steps.select_baseline.outputs.status == 'selected'
run: |
baseline_run_id="${{ steps.select_baseline.outputs.baseline_run_id }}"
baseline_dir="dist/qa/baseline/${baseline_run_id}"
mkdir -p "${baseline_dir}"
gh run download "${baseline_run_id}" \
--name ui-screenshot-linux \
--name ui-screenshot-windows \
--name ui-screenshot-macos \
--name ui-screenshot-manifest-linux \
--name ui-screenshot-manifest-windows \
--name ui-screenshot-manifest-macos \
--dir "${baseline_dir}"
env:
GH_TOKEN: ${{ github.token }}
- name: Export baseline path
id: export_baseline_path
run: |
if [ "${{ steps.select_baseline.outputs.status }}" = "selected" ]; then
echo "baseline_path=dist/qa/baseline/${{ steps.select_baseline.outputs.baseline_run_id }}" >> "${GITHUB_OUTPUT}"
else
echo "baseline_path=" >> "${GITHUB_OUTPUT}"
fi
- name: Upload baseline selection artifact
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: ui-baseline-selection
path: |
dist/qa/baseline-selection.json
dist/qa/baseline/**/*
if-no-files-found: warn
retention-days: 30
compare-ui-baseline:
name: Compare UI Baseline
if: needs.qa.result == 'success' && needs.resolve-ui-baseline.result == 'success'
needs:
- qa
- resolve-ui-baseline
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository metadata
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Download current screenshot artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
merge-multiple: false
path: dist/qa/current
pattern: ui-screenshot-*
- name: Download baseline selection artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: ui-baseline-selection
path: dist/qa/resolved-baseline
- name: Compare screenshots against selected baseline
id: compare_ui_baseline
run: node scripts/compare-ui-baseline.js
env:
UI_BASELINE_ARTIFACTS_ROOT: dist/qa/resolved-baseline/dist/qa/baseline
UI_BASELINE_SELECTION_PATH: dist/qa/resolved-baseline/dist/qa/baseline-selection.json
UI_CURRENT_ARTIFACTS_ROOT: dist/qa/current
UI_DRIFT_DIFF_OUTPUT_DIR: dist/qa/drift-diffs
UI_DRIFT_FAIL_THRESHOLD_PCT: ${{ vars.UI_DRIFT_FAIL_THRESHOLD_PCT || '0.5' }}
UI_DRIFT_PIXELMATCH_THRESHOLD: ${{ vars.UI_DRIFT_PIXELMATCH_THRESHOLD || '0.1' }}
UI_DRIFT_REPORT_PATH: dist/qa/drift-report.json
UI_DRIFT_WARN_THRESHOLD_PCT: ${{ vars.UI_DRIFT_WARN_THRESHOLD_PCT || '0.1' }}
- name: Upload drift report artifacts
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: ui-drift-report
path: |
dist/qa/drift-report.json
dist/qa/drift-diffs/**/*
if-no-files-found: warn
retention-days: 30
- name: Create baseline promotion marker
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.compare_ui_baseline.outputs.status == 'pass'
run: |
mkdir -p dist/qa
cat <<EOF > dist/qa/baseline-promotion-ready.txt
run_id=${{ github.run_id }}
run_attempt=${{ github.run_attempt }}
sha=${{ github.sha }}
status=pass
compared_images=${{ steps.compare_ui_baseline.outputs.compared_images }}
aggregate_drift_pct=${{ steps.compare_ui_baseline.outputs.aggregate_drift_pct }}
generated_at=$(date -u +%Y-%m-%dT%H:%M:%SZ)
EOF
- name: Upload baseline promotion marker
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.compare_ui_baseline.outputs.status == 'pass'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: ui-baseline-promotion-ready
path: dist/qa/baseline-promotion-ready.txt
if-no-files-found: error
retention-days: 60
updater-smoke:
name: Updater Smoke (PR)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && needs.qa.result == 'success'
needs: qa
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository metadata
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Run updater smoke tests
run: npm run test:updater-smoke
publish-unit-test-results:
name: Publish Unit Test Results (${{ matrix.os }})
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && needs.qa.result == 'success'
needs: qa
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository metadata
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
fetch-depth: 1
- name: Download unit test report artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: unit-test-results-${{ matrix.os }}
path: dist/test-results/${{ matrix.os }}
- name: Publish unit test results
uses: dorny/test-reporter@b082adf0eced0765477756c2a610396589b8c637
with:
name: Unit Tests (${{ matrix.os }})
path: dist/test-results/${{ matrix.os }}/junit.xml
reporter: jest-junit
fail-on-error: true