Repository navigation
refactor: Bump follow-redirects from 1.16.0 to 1.16.2 #3463
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: ci-performance | |
| on: | |
| pull_request: | |
| branches: | |
| - alpha | |
| - beta | |
| - release | |
| - 'release-[0-9]+.x.x' | |
| - next-major | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| env: | |
| NODE_VERSION: 24.11.0 | |
| MONGODB_VERSION: 8.0.4 | |
| permissions: | |
| contents: read | |
| jobs: | |
| performance-check: | |
| name: Benchmarks | |
| runs-on: ubuntu-latest | |
| # Allows flagged benchmarks to be measured again, see benchmark/compare.js | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 1 | |
| # The base branch is kept in a separate directory, so that both builds are available to | |
| # measure flagged benchmarks again | |
| - name: Checkout base branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.base_ref }} | |
| fetch-depth: 1 | |
| path: base | |
| - name: Use PR benchmark script for base branch | |
| run: | | |
| if [ -d benchmark ]; then | |
| rm -rf base/benchmark | |
| cp -r benchmark base/ | |
| fi | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| cache-dependency-path: | | |
| package-lock.json | |
| base/package-lock.json | |
| - name: Install dependencies (base) | |
| working-directory: base | |
| run: npm ci | |
| - name: Build Parse Server (base) | |
| working-directory: base | |
| run: npm run build | |
| - name: Install dependencies (PR) | |
| run: npm ci | |
| - name: Build Parse Server (PR) | |
| run: npm run build | |
| - name: Run baseline benchmarks | |
| id: baseline | |
| working-directory: base | |
| env: | |
| NODE_ENV: production | |
| run: | | |
| set -o pipefail | |
| echo "Running baseline benchmarks..." | |
| if [ ! -f "benchmark/performance.js" ]; then | |
| echo "⚠️ Benchmark script not found - this is expected for new features" | |
| echo "Skipping baseline benchmark" | |
| echo '[]' > ../baseline.json | |
| echo "Baseline: N/A (no benchmark script)" > ../baseline-output.txt | |
| exit 0 | |
| fi | |
| taskset -c 0 npm run benchmark 2>&1 | tee ../baseline-output.txt || npm run benchmark 2>&1 | tee ../baseline-output.txt || true | |
| # Extract JSON from output (everything between first [ and last ]) | |
| sed -n '/^\[/,/^\]/p' ../baseline-output.txt > ../baseline.json || echo '[]' > ../baseline.json | |
| continue-on-error: true | |
| - name: Upload baseline results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: baseline-benchmark | |
| path: | | |
| baseline.json | |
| baseline-output.txt | |
| retention-days: 7 | |
| - name: Run PR benchmarks | |
| id: pr-bench | |
| env: | |
| NODE_ENV: production | |
| run: | | |
| set -o pipefail | |
| echo "Running PR benchmarks..." | |
| taskset -c 0 npm run benchmark 2>&1 | tee pr-output.txt || npm run benchmark 2>&1 | tee pr-output.txt || true | |
| # Extract JSON from output (everything between first [ and last ]) | |
| sed -n '/^\[/,/^\]/p' pr-output.txt > pr.json || echo '[]' > pr.json | |
| continue-on-error: true | |
| - name: Upload PR results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pr-benchmark | |
| path: | | |
| pr.json | |
| pr-output.txt | |
| retention-days: 7 | |
| - name: Verify benchmark files exist | |
| run: | | |
| echo "Checking for benchmark result files..." | |
| if [ ! -f baseline.json ] || [ ! -s baseline.json ]; then | |
| echo "⚠️ baseline.json is missing or empty, creating empty array" | |
| echo '[]' > baseline.json | |
| fi | |
| if [ ! -f pr.json ] || [ ! -s pr.json ]; then | |
| echo "⚠️ pr.json is missing or empty, creating empty array" | |
| echo '[]' > pr.json | |
| fi | |
| echo "baseline.json size: $(wc -c < baseline.json) bytes" | |
| echo "pr.json size: $(wc -c < pr.json) bytes" | |
| - name: Compare benchmark results | |
| id: compare | |
| env: | |
| NODE_ENV: production | |
| BENCHMARK_BASE_DIR: base | |
| BENCHMARK_COMMAND: taskset -c 0 npm run benchmark | |
| run: | | |
| set -o pipefail | |
| # A PR branch that predates the comparison script has to be updated to be compared | |
| if [ ! -f benchmark/compare.js ]; then | |
| echo "⚠️ Benchmarks cannot be compared because this branch does not contain \`benchmark/compare.js\`. Update the branch with the base branch." | tee comparison.md | |
| exit 1 | |
| fi | |
| node benchmark/compare.js baseline.json pr.json | tee comparison.md | |
| - name: Upload comparison | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-comparison | |
| path: | | |
| comparison.md | |
| retest-output.txt | |
| retention-days: 30 | |
| - name: Generate job summary | |
| if: always() | |
| run: | | |
| if [ -f comparison.md ]; then | |
| cat comparison.md >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "⚠️ Benchmark comparison not available" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true |