Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add perf-guard github workflow #345

Merged
merged 31 commits into from
Dec 9, 2024
Merged
Changes from 4 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c887f14
Add perf-guard github workflow
sirbrillig Dec 2, 2024
8ab8272
Fix typo
sirbrillig Dec 2, 2024
04e7dbc
Switch to GITHUB_OUTPUT
sirbrillig Dec 2, 2024
2a8e5f2
Fix typo
sirbrillig Dec 2, 2024
9aa2905
Log performance
sirbrillig Dec 2, 2024
769bd71
Temporarily reduce baseline for testing
sirbrillig Dec 2, 2024
94601a5
Revert "Temporarily reduce baseline for testing"
sirbrillig Dec 2, 2024
eafcb48
Compare SNIFF PROCESSING TIME
sirbrillig Dec 2, 2024
2f68070
Add comment for fromJSON usage
sirbrillig Dec 8, 2024
f0271f8
Remove unnecessary fromJSON
sirbrillig Dec 8, 2024
698b1dd
Refactor to print output of phpcs alone
sirbrillig Dec 8, 2024
c0928bd
Replace WP copy of PHPMailer with tagged official version
sirbrillig Dec 8, 2024
a3759ff
Remove set x
sirbrillig Dec 8, 2024
f45a26a
Move parsing performance to own step
sirbrillig Dec 8, 2024
29a2be7
Try quoting phpcs output
sirbrillig Dec 8, 2024
22fb0ca
Use multi-line output to set var
sirbrillig Dec 8, 2024
5f016c1
Try to parse with heredoc
sirbrillig Dec 8, 2024
ffe2de0
Revert "Try to parse with heredoc"
sirbrillig Dec 8, 2024
e059e4a
Revert "Use multi-line output to set var"
sirbrillig Dec 8, 2024
c3233ee
Revert "Try quoting phpcs output"
sirbrillig Dec 8, 2024
8e360e2
Revert "Move parsing performance to own step"
sirbrillig Dec 8, 2024
ded6e9e
Temporarily decrease MAX_PHPCS_PERF_SECS
sirbrillig Dec 8, 2024
7d2a170
Decrease it further
sirbrillig Dec 8, 2024
541ff56
Revert "Decrease it further"
sirbrillig Dec 8, 2024
b90d9da
Revert "Temporarily decrease MAX_PHPCS_PERF_SECS"
sirbrillig Dec 8, 2024
f1b3180
Set MAX_PHPCS_PERF_SECS to 0.4 since 0.2 seems average
sirbrillig Dec 8, 2024
3bc4afd
Try using a file to pass perf report
sirbrillig Dec 9, 2024
07d676f
Fix escaping of env vars
sirbrillig Dec 9, 2024
9c91ded
Also output performance report
sirbrillig Dec 9, 2024
ed540b8
Temporarily break phpcs output to see what happens
sirbrillig Dec 9, 2024
f032f9a
Revert "Temporarily break phpcs output to see what happens"
sirbrillig Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/csqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,37 @@ jobs:

- name: Run Static Analysis
run: composer static-analysis

perf-guard:
name: "Basic Performance Guard"
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
coverage: none

# Install dependencies and handle caching in one go.
# Dependencies need to be installed to make sure the PHPUnit classes are recognized.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v3"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Download performance test fixture
run: wget https://raw.githubusercontent.com/WordPress/WordPress/refs/heads/master/wp-includes/PHPMailer/PHPMailer.php
sirbrillig marked this conversation as resolved.
Show resolved Hide resolved

- name: Run performance report
id: performance_report
run: echo "PHPCS_PERF_SECS=$(./vendor/bin/phpcs --standard=VariableAnalysis --report=Performance ./PHPMailer.php | grep -Eo 'TOTAL RUN TIME[ ]+[0-9.]+'|awk '{ print $4 }')" >> $GITHUB_OUTPUT
sirbrillig marked this conversation as resolved.
Show resolved Hide resolved

- name: Compare performance to baseline
if: ${{ fromJSON( steps.performance_report.outputs.PHPCS_PERF_SECS ) > 0.6 }}
jrfnl marked this conversation as resolved.
Show resolved Hide resolved
run: exit 1
Loading