|
32 | 32 | comment-id: ${{ steps.fc.outputs.comment-id }}
|
33 | 33 | edit-mode: 'replace'
|
34 | 34 | body: |
|
35 |
| - 🚀 Commit ${{ github.sha }} Deployed on https://web-php-pr-${{ github.event.number }}.preview.thephp.foundation |
| 35 | + 🚀 Preview for commit ${{ github.sha }} can be found at https://web-php-pr-${{ github.event.number }}.preview.thephp.foundation |
| 36 | +
|
| 37 | + tests_visual: |
| 38 | + name: "Visual Tests" |
| 39 | + |
| 40 | + runs-on: "ubuntu-latest" |
| 41 | + if: github.repository_owner == 'php' |
| 42 | + |
| 43 | + strategy: |
| 44 | + matrix: |
| 45 | + php-version: |
| 46 | + - "8.2" |
| 47 | + node-version: |
| 48 | + - "22.x" |
| 49 | + |
| 50 | + env: |
| 51 | + HTTP_HOST: "localhost:8080" |
| 52 | + |
| 53 | + steps: |
| 54 | + - name: "Checkout" |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + ref: "refs/pull/${{ github.event.number }}/merge" |
| 58 | + |
| 59 | + - name: "Set up PHP" |
| 60 | + uses: "shivammathur/setup-php@v2" |
| 61 | + with: |
| 62 | + coverage: "none" |
| 63 | + extensions: "none, curl, dom, json, mbstring, tokenizer, xml, xmlwriter" |
| 64 | + php-version: "${{ matrix.php-version }}" |
| 65 | + |
| 66 | + - name: Use Node.js ${{ matrix.node-version }} |
| 67 | + uses: actions/setup-node@v3 |
| 68 | + with: |
| 69 | + node-version: ${{ matrix.node-version }} |
| 70 | + |
| 71 | + - name: "Set up problem matchers for PHP" |
| 72 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" |
| 73 | + |
| 74 | + - name: "Set up problem matchers for phpunit/phpunit" |
| 75 | + run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
| 76 | + |
| 77 | + - name: "Determine composer cache directory" |
| 78 | + run: "echo \"COMPOSER_CACHE_DIR=$(composer config cache-dir)\" >> $GITHUB_ENV" |
| 79 | + |
| 80 | + - name: "Cache dependencies installed with composer" |
| 81 | + uses: "actions/cache@v3" |
| 82 | + with: |
| 83 | + path: "${{ env.COMPOSER_CACHE_DIR }}" |
| 84 | + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" |
| 85 | + restore-keys: "php-${{ matrix.php-version }}-composer-" |
| 86 | + |
| 87 | + - name: "Install dependencies with composer" |
| 88 | + run: "composer install --ansi --no-interaction --no-progress" |
| 89 | + |
| 90 | + - name: "Install dependencies" |
| 91 | + run: "yarn install" |
| 92 | + |
| 93 | + - name: "Install Playwright" |
| 94 | + run: "npx playwright install" |
| 95 | + |
| 96 | + - name: "Run visual tests" |
| 97 | + run: "make tests_visual" |
| 98 | + |
| 99 | + - uses: actions/upload-artifact@v4 |
| 100 | + if: ${{ !cancelled() }} |
| 101 | + with: |
| 102 | + name: playwright-report |
| 103 | + path: playwright-report/ |
| 104 | + retention-days: 30 |
| 105 | + |
| 106 | + - uses: easingthemes/ssh-deploy@main |
| 107 | + if: ${{ !cancelled() }} |
| 108 | + with: |
| 109 | + REMOTE_HOST: ${{ secrets.PREVIEW_REMOTE_HOST }} |
| 110 | + REMOTE_USER: ${{ secrets.PREVIEW_REMOTE_USER }} |
| 111 | + SSH_PRIVATE_KEY: ${{ secrets.PREVIEW_SSH_KEY }} |
| 112 | + SOURCE: "playwright-report/" |
| 113 | + TARGET: "/home/thephpfoundation/preview/web-php-regression-report-pr-${{ github.event.number }}/public" |
| 114 | + SCRIPT_BEFORE: bash /home/thephpfoundation/scripts/pr_created_pre.sh web-php-regression-report ${{ github.event.number }} |
| 115 | + |
| 116 | + - uses: peter-evans/find-comment@v3 |
| 117 | + if: ${{ !cancelled() }} |
| 118 | + id: snapshot |
| 119 | + with: |
| 120 | + issue-number: ${{ github.event.number }} |
| 121 | + comment-author: 'github-actions[bot]' |
| 122 | + |
| 123 | + - uses: peter-evans/create-or-update-comment@v4 |
| 124 | + if: ${{ !cancelled() }} |
| 125 | + with: |
| 126 | + issue-number: ${{ github.event.number }} |
| 127 | + comment-id: ${{ steps.snapshot.outputs.comment-id }} |
| 128 | + edit-mode: 'replace' |
| 129 | + body: | |
| 130 | + 🚀 Regression report for commit ${{ github.sha }} is at https://web-php-regression-report-pr-${{ github.event.number }}.preview.thephp.foundation |
0 commit comments