Skip to content

Security: Proxy URL construction always uses 'http' scheme regardless of proxy type #2714

Security: Proxy URL construction always uses 'http' scheme regardless of proxy type

Security: Proxy URL construction always uses 'http' scheme regardless of proxy type #2714

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- name: Enable long paths (Windows)
if: runner.os == 'Windows'
run: git config --system core.longpaths true
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
# Enable long paths for Windows (filenames > 260 chars)
config: core.longpaths=true
- name: Use Node.js 22.x
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
with:
node-version: 22.x
cache: 'npm'
- name: Fix package-lock.json
run: node scripts/patch-package-lock.js
- name: Set Playwright cache path
id: playwright-path
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "path=$HOME/.cache/ms-playwright" >> $GITHUB_OUTPUT
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "path=$HOME/Library/Caches/ms-playwright" >> $GITHUB_OUTPUT
elif [ "$RUNNER_OS" == "Windows" ]; then
# On Windows, LOCALAPPDATA is available in bash (Git Bash)
if [ -n "$LOCALAPPDATA" ]; then
echo "path=$LOCALAPPDATA/ms-playwright" >> $GITHUB_OUTPUT
else
# Fallback: use PowerShell to get the path
PLAYWRIGHT_PATH=$(powershell -Command "Write-Output $env:LOCALAPPDATA\ms-playwright")
echo "path=$PLAYWRIGHT_PATH" >> $GITHUB_OUTPUT
fi
fi
shell: bash
- name: Cache Playwright Browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5.2.3
id: playwright-cache
with:
path: ${{ steps.playwright-path.outputs.path }}
key: ${{ runner.os }}-playwright-chromium-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-chromium-
${{ runner.os }}-playwright-
- name: Install dependencies
run: npm ci --prefer-offline
- name: Rebuild SQLite native module for Electron
run: npx electron-rebuild -f -w better-sqlite3
- name: Install Playwright Browsers (full)
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- name: Install Playwright System Dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true' && runner.os != 'Windows'
run: npx playwright install-deps chromium
- name: Run linting
run: npm run lint
- name: Run type checking
run: npm run typecheck
- name: Run unit tests with coverage
run: npm run test:coverage
env:
CI: true
- name: Save Coverage Reports
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0
# Only upload artifacts on macOS - We only need coverage from one OS
if: runner.os == 'macOS'
with:
name: pr-coverage-reports
path: coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
if: runner.os == 'macOS'
with:
files: ./coverage/coverage-final.json
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true