Skip to content

Commit

Permalink
try and fix composite conditions again
Browse files Browse the repository at this point in the history
  • Loading branch information
adammino-ledger committed Nov 22, 2024
1 parent c414137 commit b333b74
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions tools/actions/composites/update-snapshots-desktop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ 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)"
description: "Name of the operating system (same as runs-on)"
required: true

runs:
using: "composite"
steps:
- name: Update playwright snapshots [Linux => xvfb-run]
if: "${{ startsWith(inputs.os, 'ubuntu') }}"
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright:update-snapshots
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- pnpm desktop test:playwright:update-snapshots
shell: bash

- name: Update playwright snapshots
if: "${{ !startsWith(inputs.os, 'ubuntu') }}"
run: |
pnpm desktop test:playwright:update-snapshots
run: pnpm desktop test:playwright:update-snapshots
shell: bash

- name: Status (Linux | macOS)
if: "${{ !startsWith(inputs.os, 'windows') }}"
id: status
run: |
echo "status=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
shell: bash

- name: Status (Windows)
id: status-windows
if: "${{ startsWith(inputs.os, 'windows') }}"
Expand All @@ -32,12 +33,15 @@ runs:
$out = $out.Trim()
echo "status=$out" >> $env:GITHUB_OUTPUT
shell: pwsh

- id: changes
run: |
echo "changes=$(git status -s)" >> $GITHUB_OUTPUT
echo ${{ steps.status.outputs.status }}
echo "changes=$(git status -s)"
shell: bash

- name: Commit snapshots
if: ${{ steps.status.outputs.status != 0 || steps.status-windows.outputs.status != 0 }}
if: "${{ steps.status.outputs.status != 0 || steps.status-windows.outputs.status != 0 }}"
run: |
git add ./apps/ledger-live-desktop/tests/specs &&
git commit -m "test(lld): update screenshots (${{ inputs.os }}) ${{ steps.changes.outputs.changes }} lld, test, screenshot" &&
Expand All @@ -46,9 +50,10 @@ runs:
git push ||
echo ""
shell: bash

- name: Upload playwright results [On Failure]
uses: actions/upload-artifact@v4
if: ${{ failure() && !cancelled() }}
if: failure() && !cancelled()
with:
name: ${{ format('playwright-results-{0}', inputs.os) }}
path: |
Expand Down

0 comments on commit b333b74

Please sign in to comment.