Daily Test Report #81
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: Daily Test Report | |
| on: | |
| schedule: | |
| # Every day at 6 AM UTC | |
| - cron: "0 6 * * *" | |
| workflow_dispatch: # Allow manual triggers | |
| concurrency: | |
| group: daily-tests | |
| cancel-in-progress: true | |
| permissions: | |
| pages: write | |
| id-token: write | |
| jobs: | |
| test-and-deploy: | |
| name: Run Tests & Deploy Report | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv (Python package manager) | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Get latest Sentry SDK versions | |
| id: sentry-versions | |
| run: | | |
| echo "js=$(npm view @sentry/node version)" >> $GITHUB_OUTPUT | |
| echo "python=$(curl -s https://pypi.org/pypi/sentry-sdk/json | python3 -c 'import sys,json; print(json.load(sys.stdin)["info"]["version"])')" >> $GITHUB_OUTPUT | |
| echo "php=$(curl -s https://repo.packagist.org/p2/sentry/sentry-laravel.json | python3 -c 'import sys,json; print(json.load(sys.stdin)["packages"]["sentry/sentry-laravel"][0]["version"])')" >> $GITHUB_OUTPUT | |
| - name: Cache Node test environments | |
| uses: actions/cache@v4 | |
| with: | |
| path: runs/node | |
| key: node-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.js }}-${{ hashFiles('src/runner/templates/**/node/**/config.json') }} | |
| restore-keys: | | |
| node-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.js }}- | |
| - name: Cache Browser test environments | |
| uses: actions/cache@v4 | |
| with: | |
| path: runs/browser | |
| key: browser-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.js }}-${{ hashFiles('src/runner/templates/**/browser/**/config.json') }} | |
| restore-keys: | | |
| browser-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.js }}- | |
| - name: Cache Next.js test environments | |
| uses: actions/cache@v4 | |
| with: | |
| path: runs/nextjs | |
| key: nextjs-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.js }}-${{ hashFiles('src/runner/templates/**/nextjs/**/config.json') }} | |
| restore-keys: | | |
| nextjs-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.js }}- | |
| - name: Cache Python test environments | |
| uses: actions/cache@v4 | |
| with: | |
| path: runs/python | |
| key: python-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.python }}-${{ hashFiles('src/runner/templates/**/python/**/config.json') }} | |
| restore-keys: | | |
| python-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.python }}- | |
| - name: Cache PHP test environments | |
| uses: actions/cache@v4 | |
| with: | |
| path: runs/php | |
| key: php-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.php }}-${{ hashFiles('src/runner/templates/**/php/**/config.json') }} | |
| restore-keys: | | |
| php-envs-daily-${{ runner.os }}-sentry-${{ steps.sentry-versions.outputs.php }}- | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| tools: composer | |
| - name: Install dependencies and build | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Install Playwright browsers (for browser platform only) | |
| run: npx playwright install --with-deps chromium | |
| - name: Run tests | |
| continue-on-error: true | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| GOOGLE_GENAI_API_KEY: ${{ secrets.GOOGLE_GENAI_API_KEY }} | |
| CO_API_KEY: ${{ secrets.CO_API_KEY }} | |
| run: npm run test -- -j=12 | |
| - name: Generate HTML report | |
| run: | | |
| CTRF_FILE=$(ls -t test-results/ctrf-report-*.json | head -1) | |
| npm run report "$CTRF_FILE" | |
| TODAY=$(date -u +%Y-%m-%d) | |
| mkdir -p "_site/reports/${TODAY}" | |
| REPORT=$(ls -t test-results/test-report-*.html | head -1) | |
| cp "$REPORT" _site/index.html | |
| # Copy scripts directory for source file links | |
| if [ -d test-results/scripts ]; then | |
| cp -r test-results/scripts _site/scripts | |
| fi | |
| # Dated copy with adjusted relative links (trends.html and scripts/ are two levels up) | |
| sed 's|href="trends.html"|href="../../trends.html"|g; s|href="scripts/|href="../../scripts/|g' "$REPORT" > "_site/reports/${TODAY}/index.html" | |
| - name: Upload CTRF artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ctrf-report-${{ github.run_id }} | |
| path: test-results/ctrf-report-*.json | |
| retention-days: 90 | |
| - name: Fetch existing history from GitHub Pages | |
| continue-on-error: true | |
| run: | | |
| PAGES_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" | |
| curl -sSf "${PAGES_URL}/history.json" -o history.json 2>/dev/null || echo "[]" > history.json | |
| - name: Seed history from past CI runs (one-time) | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if [ "$(cat history.json 2>/dev/null)" = "[]" ] || [ ! -s history.json ]; then | |
| echo "No existing history found, seeding from past workflow runs..." | |
| node .github/scripts/extract-history.cjs history.json | |
| fi | |
| - name: Update history with today's results | |
| run: | | |
| CTRF_FILE=$(ls -t test-results/ctrf-report-*.json | head -1) | |
| node .github/scripts/update-history.cjs "$CTRF_FILE" history.json | |
| - name: Fetch existing dated reports from GitHub Pages | |
| continue-on-error: true | |
| run: | | |
| PAGES_URL="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" | |
| node .github/scripts/fetch-existing-reports.cjs history.json _site "${PAGES_URL}" | |
| - name: Merge platform seed into history | |
| run: | | |
| node .github/scripts/merge-platform-seed.cjs history.json .github/data/platform-seed.json | |
| - name: Generate trends page | |
| run: | | |
| node .github/scripts/generate-trends-page.cjs history.json _site/trends.html _site/reports | |
| cp history.json _site/history.json | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| - name: Deploy to GitHub Pages | |
| id: deploy | |
| uses: actions/deploy-pages@v4 |