npm(deps): bump next from 15.3.1-canary.15 to 15.5.12 in /account #405
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: Run Tests and Update Status | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| run-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| zone: [home, catalog, account, shared] | |
| env: | |
| # Home zone environment variables | |
| NEXT_PUBLIC_HOME_ASSET_PREFIX: /home | |
| NEXT_PUBLIC_CATALOG_URL: http://localhost:3001 | |
| NEXT_PUBLIC_CATALOG_BASE_PATH: /catalog | |
| NEXT_PUBLIC_ACCOUNT_URL: http://localhost:3002 | |
| NEXT_PUBLIC_ACCOUNT_BASE_PATH: /account | |
| # Catalog zone environment variables | |
| NEXT_PUBLIC_CATALOG_ASSET_PREFIX: /catalog | |
| # Account zone environment variables | |
| NEXT_PUBLIC_ACCOUNT_ASSET_PREFIX: /account | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build shared package | |
| if: matrix.zone != 'shared' | |
| run: | | |
| cd shared | |
| npm run build | |
| - name: Build ${{ matrix.zone }} | |
| run: | | |
| cd ${{ matrix.zone }} | |
| if [ -f package.json ] && grep -q '"build"' package.json; then npm run build; fi | |
| - name: Run architecture tests for ${{ matrix.zone }} | |
| id: arch-test | |
| continue-on-error: true | |
| run: | | |
| cd ${{ matrix.zone }} | |
| npm run test:architecture | |
| echo "arch_status=$?" >> $GITHUB_ENV | |
| - name: Run size check for ${{ matrix.zone }} | |
| id: size-check | |
| continue-on-error: true | |
| run: | | |
| cd ${{ matrix.zone }} | |
| if [ -f package.json ] && grep -q '"size"' package.json; then npm run size; else exit 0; fi | |
| echo "size_status=$?" >> $GITHUB_ENV | |
| - name: Create test result file | |
| run: | | |
| echo "${{ matrix.zone }}:arch:${{ steps.arch-test.outcome }}" >> test-results.txt | |
| echo "${{ matrix.zone }}:size:${{ steps.size-check.outcome }}" >> test-results.txt | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.zone }} | |
| path: test-results.txt | |
| update-readme: | |
| needs: run-tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download all test results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: test-results | |
| - name: Generate test status section | |
| run: | | |
| echo "## Test Status" > temp-test-status.md | |
| echo "" >> temp-test-status.md | |
| echo "| Zone | Architecture Tests | Size Check |" >> temp-test-status.md | |
| echo "|------|-------------------|------------|" >> temp-test-status.md | |
| for zone in home catalog account shared; do | |
| arch_status=$(grep "$zone:arch:" test-results/test-results-$zone/test-results.txt | cut -d':' -f3) | |
| size_status=$(grep "$zone:size:" test-results/test-results-$zone/test-results.txt | cut -d':' -f3) | |
| arch_emoji="✅" | |
| if [ "$arch_status" != "success" ]; then | |
| arch_emoji="❌" | |
| fi | |
| size_emoji="✅" | |
| if [ "$size_status" != "success" ]; then | |
| size_emoji="❌" | |
| fi | |
| echo "| $zone | $arch_emoji | $size_emoji |" >> temp-test-status.md | |
| done | |
| - name: Update README.md with test status | |
| run: | | |
| awk ' | |
| BEGIN { p=1 } | |
| /^## Test Status/ { p=0; system("cat temp-test-status.md"); next } | |
| p { print } | |
| ' README.md > README.md.new | |
| mv README.md.new README.md | |
| rm temp-test-status.md | |
| - name: Commit and push if changed | |
| run: | | |
| git config --global user.name 'GitHub Action' | |
| git config --global user.email 'action@github.com' | |
| git add README.md | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "Update test status" && git push) |