File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -105,3 +105,35 @@ jobs:
105105
106106 - name : Run Static Analysis
107107 run : composer static-analysis
108+
109+ perf-guard :
110+ name : " Basic Performance Guard"
111+ runs-on : ubuntu-latest
112+
113+ steps :
114+ - name : Checkout code
115+ uses : actions/checkout@v4
116+
117+ - name : Install PHP
118+ uses : shivammathur/setup-php@v2
119+ with :
120+ php-version : " 8.1"
121+ coverage : none
122+
123+ # Install dependencies and handle caching in one go.
124+ # Dependencies need to be installed to make sure the PHPUnit classes are recognized.
125+ # @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
126+ - name : Install Composer dependencies
127+ uses : " ramsey/composer-install@v3"
128+ with :
129+ # Bust the cache at least once a month - output format: YYYY-MM.
130+ custom-cache-suffix : $(date -u "+%Y-%m")
131+
132+ - name : Download performance test fixture
133+ run : wget https://raw.githubusercontent.com/WordPress/WordPress/refs/heads/master/wp-includes/PHPMailer/PHPMailer.php
134+
135+ - name : Run performance report
136+ run : _PHPCS_RUNTIME=$(./vendor/bin/phpcs --standard=VariableAnalysis --report=Performance ./PHPMailer.php | grep -Eo 'TOTAL RUN TIME[ ]+[0-9.]+'|awk '{ print $4 }')
137+
138+ - name : Compare performance to baseline
139+ run : if awk "BEGIN {exit !($_PHPC_RUNTIME > 0.6)}"; then exit 1; fi
You can’t perform that action at this time.
0 commit comments