-
Notifications
You must be signed in to change notification settings - Fork 294
/
action.yml
61 lines (60 loc) · 2.29 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "Update Snapshots Ledger Live Desktop"
description: "Composite job to update playwright snapshots for Ledger Live Desktop"
inputs:
os:
description: "name of the os (same as runs-on)"
required: true
turbo-server-port:
description: "port on which the turborepo local cache server is running"
required: true
runs:
using: "composite"
steps:
- name: Install dependencies
run: pnpm i --filter="ledger-live-desktop..." --filter="ledger-live" --frozen-lockfile --unsafe-perm
shell: bash
- name: Install playwright dependencies
run: npx playwright@1.27.1 install --with-deps chromium
shell: bash
- name: Build dependencies
env:
GOGC: 75
run: |
pnpm build:lld:deps --api="http://127.0.0.1:${{ inputs.turbo-server-port }}" --token="yolo" --team="foo"
pnpm desktop build:testing
shell: bash
- name: Build Dummy SDK app for testing
run: pnpm --filter="dummy-live-app" i && pnpm --filter="dummy-live-app" build
shell: bash
- name: Update playwright snapshots [Linux => xvfb-run]
if: inputs.os == 'ubuntu-latest'
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright:update-snapshots
shell: bash
- name: Update playwright snapshots
if: inputs.os != 'ubuntu-latest'
run: pnpm desktop test:playwright:update-snapshots
shell: bash
- name: status
id: status
run: echo "::set-output name=status::$(git status --porcelain | wc -l)"
shell: bash
- name: Commit snapshots
if: steps.status.outputs.status != 0
run: >
git add ./apps/ledger-live-desktop/tests/specs &&
git commit -m 'update screenshots (${{ inputs.os }})' &&
git restore . &&
git pull --rebase &&
git push ||
echo ""
shell: bash
- name: Upload playwright results [On Failure]
uses: actions/upload-artifact@v3
if: failure() && !cancelled()
with:
name: ${{ format('playwright-results-{0}', inputs.os) }}
path: |
apps/ledger-live-desktop/tests/artifacts/test-results
apps/ledger-live-desktop/tests/artifacts/html-report
apps/ledger-live-desktop/tests/artifacts/coverage
apps/ledger-live-desktop/tests/artifacts/videos