Skip to content

Commit 85369a2

Browse files
committed
Add GitHub workflow
Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent e772ddd commit 85369a2

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,50 @@ jobs:
6363
if: github.repository == 'phpmyadmin/sql-parser'
6464
with:
6565
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
66+
67+
php-benchmark:
68+
name: Benchmark on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
69+
runs-on: ${{ matrix.os }}
70+
continue-on-error: ${{ matrix.experimental }}
71+
strategy:
72+
matrix:
73+
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
74+
os: [ubuntu-latest]
75+
experimental: [false]
76+
composer-options: ['']
77+
include:
78+
- { php-version: 'nightly', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
79+
steps:
80+
- uses: actions/checkout@v3
81+
with:
82+
# Fetch some commits for Scrutinizer coverage upload
83+
fetch-depth: 15
84+
- name: Use PHP ${{ matrix.php-version }}
85+
uses: shivammathur/setup-php@v2
86+
with:
87+
php-version: ${{ matrix.php-version }}
88+
# phar, json and curl are used by composer
89+
# json is used by testing code
90+
# dom, json, mbstring, libxml, xml, xmlwriter are used by phpunit
91+
# tokenizer, xmlwriter and simplexml are used by phpcs
92+
# ctype is used by Psalm
93+
extensions: none, mbstring, phar, json, curl, tokenizer, xml, xmlwriter, simplexml, libxml, dom, ctype
94+
coverage: xdebug
95+
- name: Get Composer Cache Directory
96+
id: composer-cache
97+
run: |
98+
echo "::set-output name=dir::$(composer config cache-files-dir)"
99+
- name: Restore cache
100+
uses: actions/cache@v3
101+
with:
102+
path: ${{ steps.composer-cache.outputs.dir }}
103+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
104+
restore-keys: |
105+
${{ runner.os }}-composer-
106+
- name: Install dependencies
107+
run: composer install --no-interaction ${{ matrix.composer-options }}
108+
- name: Install motranslator
109+
if: ${{ matrix.php-version == '7.1' }}
110+
run: composer require phpmyadmin/motranslator:^3.0
111+
- name: Run benchmarks
112+
run: composer run phpbench

0 commit comments

Comments
 (0)