Skip to content

Commit

Permalink
re-add all steps to snapshots action, fix git add and commit params
Browse files Browse the repository at this point in the history
  • Loading branch information
angusbayley committed Jan 6, 2025
1 parent 1db3fd4 commit d4fa67a
Showing 1 changed file with 46 additions and 50 deletions.
96 changes: 46 additions & 50 deletions tools/actions/composites/update-snapshots-desktop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,72 @@ inputs:
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
# shell: bash
- 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
shell: bash

# - name: Update playwright snapshots
# if: ${{ !startsWith(inputs.os, 'ubuntu') }}
# run: |
# pnpm desktop test:playwright:update-snapshots
# shell: bash
- name: Update playwright snapshots
if: ${{ !startsWith(inputs.os, 'ubuntu') }}
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 (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') }}
# run: |
# $out = $(git status --porcelain | measure -l | Format-Wide | Out-String -Stream)
# $out = $out.Trim()
# echo "status=$out" >> $env:GITHUB_OUTPUT
# shell: pwsh
- name: Status (Windows)
id: status-windows
if: ${{ startsWith(inputs.os, 'windows') }}
run: |
$out = $(git status --porcelain | measure -l | Format-Wide | Out-String -Stream)
$out = $out.Trim()
echo "status=$out" >> $env:GITHUB_OUTPUT
shell: pwsh

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

- name: Echo git status
run: git status
shell: bash

- name: Create a dummy file
- name: Add changed files
run: |
<<<<<<< Updated upstream
git pull --rebase
echo "This is a dummy file" > dummy.txt
=======
>>>>>>> Stashed changes
git add .
git stash -u
git pull --rebase
git stash pop
git add ./apps/ledger-live-desktop/tests/specs
shell: bash

- name: Echo git status 2
run: git status
shell: bash

- name: Get current branch
id: get_branch
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
shell: bash

- uses: planetscale/[email protected]
- name: Commit file
uses: planetscale/[email protected]
if: ${{ steps.status.outputs.status != 0 || steps.status-windows.outputs.status != 0 }}
with:
commit_message: "test commit"
commit_message: "test(lld): update screenshots (${{ inputs.os }}) ${{ steps.changes.outputs.changes }} lld, test, screenshot"
repo: ${{ github.repository }}
branch: ${{ env.branch }}
file_pattern: '*.txt'
file_pattern: '*'
env:
GITHUB_TOKEN: ${{ inputs.token }}

# - name: Commit file
# uses: swinton/[email protected]
# if: ${{ steps.status.outputs.status != 0 || steps.status-windows.outputs.status != 0 }}
# env:
# GH_TOKEN: ${{ inputs.token }}
# with:
# files: |
# $(git status --porcelain | awk '{print $2}' | sed 's/^/ /')
# commit-message: "test(lld): update screenshots (${{ inputs.os }}) ${{ steps.changes.outputs.changes }} lld, test, screenshot"
# ref: $(git branch --show-current)

- name: Upload playwright results [On Failure]
uses: actions/upload-artifact@v4
if: failure() && !cancelled()
Expand Down

0 comments on commit d4fa67a

Please sign in to comment.