Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test PR] use swinton to make signed commit during desktop snapshots #8793

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ permissions:

jobs:
generate-screenshots-linux:
permissions:
id-token: write
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
env:
NODE_OPTIONS: "--max-old-space-size=7168"
FORCE_COLOR: 3
Expand Down Expand Up @@ -74,10 +79,11 @@ jobs:
skip_ruby: true
install_playwright: true
turborepo-server-port: ${{ steps.caches.outputs.port }}
- uses: LedgerHQ/ledger-live/tools/actions/composites/update-snapshots-desktop@develop
- uses: LedgerHQ/ledger-live/tools/actions/composites/update-snapshots-desktop@support/signed-screenshot-gh-commits-swinton
id: update-snapshots
with:
os: ubuntu-22.04
token: ${{ secrets.GITHUB_TOKEN }}

report-start:
name: Report start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Text from "~/renderer/components/Text";
const Tab = styled(Base)<{
active: boolean;
}>`
padding: 0 16px 4px 16px;
padding: 0 200px 4px 16px;
border-radius: 0;
flex: ${({ fullWidth }) => (fullWidth ? "1" : "initial")};
display: flex;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 60 additions & 35 deletions tools/actions/composites/update-snapshots-desktop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,79 @@ inputs:
os:
description: "name of the os (same as runs-on)"
required: true
token:
description: "GitHub token"
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
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
# - 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

- name: Configure Git
run: |
echo "status=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
shell: bash
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Status (Windows)
id: status-windows
if: ${{ startsWith(inputs.os, 'windows') }}
- name: Setup GitHub Authentication
run: |
$out = $(git status --porcelain | measure -l | Format-Wide | Out-String -Stream)
$out = $out.Trim()
echo "status=$out" >> $env:GITHUB_OUTPUT
shell: pwsh
# git remote set-url origin https://github.com/${{ github.repository }}
git config --global credential.helper cache
echo "url=https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com" > ~/.git-credentials
git config --global credential.helper store

- id: changes
- name: Make changes and commit
run: |
echo ${{ steps.status.outputs.status }}
echo "changes=$(git status -s)"
shell: bash
echo "Test commit" > file.txt
git add .
git commit -m "Automated commit"

- name: Commit snapshots
if: ${{ steps.status.outputs.status != 0 || steps.status-windows.outputs.status != 0 }}
- name: Push changes
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" &&
git restore . &&
git pull --rebase &&
git push ||
echo ""
shell: bash
git push origin HEAD:main

# - 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
Expand Down
Loading