chore(deps): update github artifact actions (major) #8045
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: e2e | |
| on: | |
| pull_request: | |
| branches: [develop, refactor/develop] | |
| concurrency: | |
| group: e2e-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} | |
| NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} | |
| NEXT_PUBLIC_GTM_ID: ${{ secrets.NEXT_PUBLIC_GTM_ID }} | |
| jobs: | |
| e2e: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Record setup start | |
| run: echo "SETUP_START=$(date +%s)" >> $GITHUB_ENV | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Measure setup time | |
| run: | | |
| SETUP_END=$(date +%s) | |
| SETUP_TIME=$((SETUP_END - SETUP_START)) | |
| echo "⚡ E2E Setup Time: ${SETUP_TIME}s" >> $GITHUB_STEP_SUMMARY | |
| - name: Setup Playwright | |
| uses: ./.github/actions/playwright | |
| - name: Record e2e start | |
| run: echo "E2E_START=$(date +%s)" >> $GITHUB_ENV | |
| - name: Playwright test | |
| run: pnpm e2e | |
| - name: Measure e2e time | |
| run: | | |
| E2E_END=$(date +%s) | |
| E2E_TIME=$((E2E_END - E2E_START)) | |
| echo "🎭 E2E Test Time: ${E2E_TIME}s" >> $GITHUB_STEP_SUMMARY | |
| if [ "$E2E_TIME" -lt 300 ]; then | |
| echo "🎯 E2E高速実行: 良好なパフォーマンス!" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "🐌 E2E実行時間: 通常範囲" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - uses: actions/upload-artifact@v7 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| upload-to-github-pages: | |
| needs: e2e | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout hosting-pages | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: yn1323/hosting-pages | |
| token: ${{ secrets.HOSTING_PAGES_TOKEN }} | |
| ref: main | |
| - name: Download Playwright Report Artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: playwright-report | |
| path: "./online-draft/playwright/${{ github.event.pull_request.number }}" | |
| - name: Commit and push changes with retry | |
| shell: bash | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add online-draft | |
| git commit -m "chore: Update Playwright report for online-draft PR #${{ github.event.pull_request.number }}" | |
| # リトライロジック - 最大5回まで試行 | |
| for i in {1..5}; do | |
| if git push; then | |
| echo "Successfully pushed on attempt $i" | |
| break | |
| else | |
| if [ $i -eq 5 ]; then | |
| echo "Failed to push after 5 attempts" | |
| exit 1 | |
| fi | |
| echo "Push failed on attempt $i, retrying..." | |
| sleep 5 | |
| git pull --rebase origin main | |
| fi | |
| done | |
| - name: Create comments | |
| if: github.event_name == 'pull_request' | |
| uses: mshick/add-pr-comment@v2 | |
| with: | |
| message-id: playwright | |
| message: | | |
| 🎭 Playwright Test Report 🎭 | |
| [Playwright Report](https://yn1323.github.io/hosting-pages/online-draft/playwright/${{ github.event.pull_request.number }}) |