feat: transaction history for ton #640
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Visual Regression Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| chromatic: | |
| name: Run Chromatic | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm --filter "@reown/appkit-common" --filter "@reown/appkit-polyfills" --filter "@reown/appkit-wallet" --filter "@reown/appkit-controllers" --filter "@reown/appkit-ui" --filter "@reown/appkit-utils" --filter "@reown/appkit-scaffold-ui" build | |
| - name: Run Chromatic | |
| id: chromatic | |
| continue-on-error: true | |
| uses: chromaui/action@latest | |
| with: | |
| projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
| workingDir: apps/gallery | |
| buildScriptName: build | |
| onlyChanged: true | |
| autoAcceptChanges: false | |
| exitZeroOnChanges: false | |
| zip: true | |
| - name: Comment on PR with Chromatic results | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const chromaticUrl = '${{ steps.chromatic.outputs.url }}'; | |
| const buildUrl = '${{ steps.chromatic.outputs.buildUrl }}'; | |
| const storybookUrl = '${{ steps.chromatic.outputs.storybookUrl }}'; | |
| const changeCount = '${{ steps.chromatic.outputs.changeCount }}'; | |
| const outcome = '${{ steps.chromatic.outcome }}'; | |
| const status = outcome === 'success' ? '✅ Passed' : '❌ Failed'; | |
| const changesText = changeCount > 0 ? `⚠️ ${changeCount} visual change(s) detected` : '✨ No visual changes detected'; | |
| const commentBody = `## Visual Regression Test Results ${status} | |
| ${changesText} | |
| **Chromatic Build:** ${buildUrl || chromaticUrl || 'URL not available'} | |
| **Storybook Preview:** ${storybookUrl || 'Not available'} | |
| ${changeCount > 0 ? '👉 Please review the visual changes in Chromatic and accept or reject them.' : ''}`; | |
| // Find existing comment | |
| const comments = await github.rest.issues.listComments({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| }); | |
| const botComment = comments.data.find(comment => | |
| comment.user.type === 'Bot' && | |
| comment.body.includes('Visual Regression Test Results') | |
| ); | |
| // Update existing comment or create new one | |
| if (botComment) { | |
| await github.rest.issues.updateComment({ | |
| comment_id: botComment.id, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: commentBody | |
| }); | |
| } else { | |
| await github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: commentBody | |
| }); | |
| } | |
| - name: Fail workflow if visual changes detected | |
| if: steps.chromatic.outcome == 'failure' | |
| run: | | |
| echo "❌ Visual changes detected - workflow failed" | |
| exit 1 |