Some checks failed
Build and Test / fetch (push) Failing after 2m11s
Build and Test / Windows (arm64) (push) Has been skipped
Build and Test / Windows (ia32) (push) Has been skipped
Static Analysis / i18n Check (push) Failing after 0s
Build and Test / Windows (x64) (push) Has been skipped
Build and Test / Linux (amd64) (sqlcipher: static) (push) Has been skipped
Build and Test / Linux (amd64) (sqlcipher: system) (push) Has been skipped
Build and Test / Linux (arm64) (sqlcipher: static) (push) Has been skipped
Build and Test / Linux (arm64) (sqlcipher: system) (push) Has been skipped
Build and Test / macOS (push) Has been skipped
Sync labels / sync-labels (push) Failing after 1s
Build and Deploy / prepare (push) Failing after 2m15s
Build and Deploy / Windows arm64 (push) Has been skipped
Build and Deploy / Windows x64 (push) Has been skipped
Build and Deploy / macOS (push) Has been skipped
Build and Deploy / Linux amd64 (sqlcipher static) (push) Has been skipped
Build and Deploy / Linux arm64 (sqlcipher static) (push) Has been skipped
Build and Test / tests-done (push) Has been cancelled
Static Analysis / Typescript Syntax Check (push) Has been cancelled
Static Analysis / ESLint (push) Has been cancelled
Static Analysis / Workflow Lint (push) Has been cancelled
Static Analysis / Analyse Dead Code (push) Has been cancelled
Close stale PRs / close (push) Has been cancelled
Build and Deploy / ${{ needs.prepare.outputs.deploy == 'true' && 'Deploy' || 'Deploy (dry-run)' }} (push) Has been cancelled
Build and Deploy / Deploy builds to ESS (push) Has been cancelled
91 lines
3.4 KiB
YAML
91 lines
3.4 KiB
YAML
# This action helps run Playwright tests within one of the build_* stages.
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
runs-on:
|
|
type: string
|
|
required: true
|
|
description: "The runner image to use"
|
|
artifact:
|
|
type: string
|
|
required: true
|
|
description: "The name of the artifact to download"
|
|
executable:
|
|
type: string
|
|
required: true
|
|
description: "Path to the executable to test"
|
|
prepare_cmd:
|
|
type: string
|
|
required: false
|
|
description: "Command to run to prepare the executable or environment for testing"
|
|
blob_report:
|
|
type: boolean
|
|
default: false
|
|
description: "Whether to upload a blob report instead of the HTML report"
|
|
permissions: {}
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ inputs.runs-on }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .node-version
|
|
cache: "yarn"
|
|
|
|
- name: Install Deps
|
|
run: "yarn install --frozen-lockfile"
|
|
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: ${{ inputs.artifact }}
|
|
path: dist
|
|
|
|
- name: Prepare for tests
|
|
run: ${{ inputs.prepare_cmd }}
|
|
if: inputs.prepare_cmd
|
|
|
|
- name: Expand executable path
|
|
id: executable
|
|
shell: bash
|
|
env:
|
|
EXECUTABLE: ${{ inputs.executable }}
|
|
run: |
|
|
FILES=($EXECUTABLE)
|
|
echo "path=${FILES[0]}" >> $GITHUB_OUTPUT
|
|
|
|
# We previously disabled the `EnableNodeCliInspectArguments` fuse, but Playwright requires
|
|
# it to be enabled to test Electron apps, so turn it back on.
|
|
- name: Set EnableNodeCliInspectArguments fuse enabled
|
|
run: $RUN_AS npx @electron/fuses write --app "$EXECUTABLE" EnableNodeCliInspectArguments=on
|
|
shell: bash
|
|
env:
|
|
# We need sudo on Linux as it is installed in /opt/
|
|
RUN_AS: ${{ runner.os == 'Linux' && 'sudo' || '' }}
|
|
EXECUTABLE: ${{ steps.executable.outputs.path }}
|
|
|
|
- name: Run tests
|
|
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
|
|
timeout-minutes: 5
|
|
with:
|
|
run: yarn test --project=${{ inputs.artifact }} ${{ runner.os != 'Linux' && '--ignore-snapshots' || '' }} ${{ inputs.blob_report == false && '--reporter=html' || '' }}
|
|
env:
|
|
ELEMENT_DESKTOP_EXECUTABLE: ${{ steps.executable.outputs.path }}
|
|
|
|
- name: Upload blob report
|
|
if: always() && inputs.blob_report
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: blob-report-${{ inputs.artifact }}
|
|
path: blob-report
|
|
retention-days: 1
|
|
|
|
- name: Upload HTML report
|
|
if: always() && inputs.blob_report == false
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ inputs.artifact }}-test
|
|
path: playwright-report
|
|
retention-days: 14
|