diff --git a/.github/workflows/generate-screenshots.yml b/.github/workflows/generate-screenshots.yml index 7752446dacba..3c6900bf6e35 100644 --- a/.github/workflows/generate-screenshots.yml +++ b/.github/workflows/generate-screenshots.yml @@ -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 @@ -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 diff --git a/apps/ledger-live-desktop/src/renderer/components/TabBar.tsx b/apps/ledger-live-desktop/src/renderer/components/TabBar.tsx index a5b1975ea1f4..e54b2609473a 100644 --- a/apps/ledger-live-desktop/src/renderer/components/TabBar.tsx +++ b/apps/ledger-live-desktop/src/renderer/components/TabBar.tsx @@ -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; diff --git a/apps/ledger-live-desktop/tests/specs/manager/manager.spec.ts-snapshots/manager-installed-apps-linux.png b/apps/ledger-live-desktop/tests/specs/manager/manager.spec.ts-snapshots/manager-installed-apps-linux.png index 3e2fc30b58bb..ffd3cd361ec8 100644 Binary files a/apps/ledger-live-desktop/tests/specs/manager/manager.spec.ts-snapshots/manager-installed-apps-linux.png and b/apps/ledger-live-desktop/tests/specs/manager/manager.spec.ts-snapshots/manager-installed-apps-linux.png differ diff --git a/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-about-page-linux.png b/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-about-page-linux.png index 62a19b7f5902..4e6585535d18 100644 Binary files a/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-about-page-linux.png and b/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-about-page-linux.png differ diff --git a/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-experimental-page-linux.png b/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-experimental-page-linux.png index 6f68df5e1d72..d15162e0b152 100644 Binary files a/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-experimental-page-linux.png and b/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-experimental-page-linux.png differ diff --git a/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-help-page-linux.png b/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-help-page-linux.png index ed0943dd6f83..c78fc6b1fdaa 100644 Binary files a/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-help-page-linux.png and b/apps/ledger-live-desktop/tests/specs/settings/settings.spec.ts-snapshots/settings-help-page-linux.png differ diff --git a/tools/actions/composites/update-snapshots-desktop/action.yml b/tools/actions/composites/update-snapshots-desktop/action.yml index 36cee6473d2e..45c87aceb1a8 100644 --- a/tools/actions/composites/update-snapshots-desktop/action.yml +++ b/tools/actions/composites/update-snapshots-desktop/action.yml @@ -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/commit@v2.0.0 + # 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