Skip to content

Add the read-only analysis catalog panel #951

Add the read-only analysis catalog panel

Add the read-only analysis catalog panel #951

Workflow file for this run

name: Test
on:
push:
branches: ['main', 'release-prep', 'hotfix-*']
pull_request:
branches: ['main', 'release-prep', 'hotfix-*']
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout git repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: extension-repo
persist-credentials: false
- name: Checkout paranext-core repo to use its sub-packages
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: paranext-core
repository: paranext/paranext-core
persist-credentials: false
# This repo pins no paranext-core ref, so each run silently builds against whatever the
# default branch HEAD is at that moment — two runs minutes apart can differ. Record the
# resolved revision so a red run says which core it built against instead of leaving it to be
# reconstructed from raw logs later.
- name: Record paranext-core revision
working-directory: paranext-core
shell: bash
run: |
echo "### paranext-core \`$(git rev-parse --short HEAD)\`" >> "$GITHUB_STEP_SUMMARY"
git log -1 --format='%H%n%ad%n%s' --date=iso | tee -a "$GITHUB_STEP_SUMMARY"
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'npm'
cache-dependency-path: |
extension-repo/package-lock.json
paranext-core/package-lock.json
node-version-file: extension-repo/package.json
- name: Install extension dependencies
working-directory: extension-repo
# Cannot --omit=optional: @swc/core-win32-x64-msvc is an optional dep and SWC needs it to
# transpile TypeScript in Jest on Windows.
run: npm ci --ignore-scripts
- name: Install core dependencies
working-directory: paranext-core
run: npm ci --ignore-scripts --omit=optional
- name: Run tests
working-directory: extension-repo
run: npm run test:coverage
e2e:
runs-on: ${{ matrix.os }}
strategy:
# Don't cancel the other OS's e2e run when one fails — we want both reports.
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout git repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: extension-repo
persist-credentials: false
- name: Checkout paranext-core repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: paranext-core
repository: paranext/paranext-core
persist-credentials: false
# See the matching step in the `test` job: the core revision floats, so record which one this
# run used. Especially load-bearing here — the e2e tier is where upstream core changes surface.
- name: Record paranext-core revision
working-directory: paranext-core
shell: bash
run: |
echo "### paranext-core \`$(git rev-parse --short HEAD)\`" >> "$GITHUB_STEP_SUMMARY"
git log -1 --format='%H%n%ad%n%s' --date=iso | tee -a "$GITHUB_STEP_SUMMARY"
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'npm'
cache-dependency-path: |
extension-repo/package-lock.json
paranext-core/package-lock.json
node-version-file: extension-repo/package.json
- name: Install extension dependencies
working-directory: extension-repo
# Cannot --omit=optional: @swc/core-win32-x64-msvc is an optional dep; webpack needs it to
# transpile TypeScript on Windows.
run: npm ci --ignore-scripts
- name: Install core dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: paranext-core
# Cannot --omit=optional: lightningcss native binaries are optional deps required by the
# webpack build.
run: npm ci --ignore-scripts
- name: Install core dependencies (Windows)
if: matrix.os == 'windows-latest'
working-directory: paranext-core
shell: pwsh
# Same install as Linux, but retried: this full install fetches the most packages
# through the shared C:\npm\cache and intermittently races on _cacache\tmp (EEXIST) or hits a
# locked node_modules file during npm's pre-install cleanup (EPERM rmdir). `npm cache verify`
# between attempts evicts the corrupt/partial cache entry so the retry starts clean.
run: |
$ErrorActionPreference = 'Continue'
for ($attempt = 1; $attempt -le 3; $attempt++) {
Write-Host "npm ci attempt $attempt of 3"
npm ci --ignore-scripts
if ($LASTEXITCODE -eq 0) { exit 0 }
Write-Host "npm ci failed (exit $LASTEXITCODE); verifying cache before retry"
npm cache verify
if ($LASTEXITCODE -ne 0) { Write-Host "npm cache verify failed (exit $LASTEXITCODE)" }
}
Write-Error 'npm ci failed after 3 attempts'
exit 1
- name: Install Electron binary
working-directory: paranext-core
run: node node_modules/electron/install.js
- name: Install system dependencies for Electron
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends xvfb libgbm-dev libnss3 libxss1 libasound2t64
- name: Build extension
working-directory: extension-repo
run: npm run build
- name: Build paranext-core dev bundle
working-directory: paranext-core
run: npm run prestart
- name: Build paranext-core renderer DLL
working-directory: paranext-core
run: npm run build:dll
- name: Run e2e tests (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: extension-repo
# Linux needs an xvfb display
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" npm run test:e2e
- name: Run e2e tests (Windows)
if: matrix.os == 'windows-latest'
working-directory: extension-repo
run: npm run test:e2e
- name: Upload Playwright test results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: playwright-results-${{ matrix.os }}
retention-days: 7
path: |
extension-repo/e2e-tests/.cdp-app-startup.log
extension-repo/e2e-tests/.smoke-app-startup.log
extension-repo/e2e-tests/playwright-report/
extension-repo/e2e-tests/test-results/
if-no-files-found: warn
# upload-artifact excludes hidden files by default (since v4.4), which silently dropped
# the dotfile app-startup log from every artifact.
include-hidden-files: true