-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
on: | ||
pull_request: | ||
|
||
name: "Benchmarks" | ||
|
||
jobs: | ||
run: | ||
name: "Benchmarks" | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: ["8.1"] | ||
|
||
steps: | ||
- name: Set git to use LF | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Install PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: none | ||
|
||
- name: Get Composer Cache Directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
ref: main | ||
fetch-depth: 1 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Install dependencies required for benchmarks | ||
run: make install-benchmarks | ||
|
||
- name: Run benchmarks | ||
run: "vendor/bin/phpbench run --php-config='opcache.enable_cli: true' tests/benchmarks --report=test --tag=main" | ||
|
||
- name: Clear vendor files | ||
run: | | ||
rm -rf vendor composer.lock | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
clean: false | ||
fetch-depth: 1 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Install dependencies required for benchmarks | ||
run: make install-benchmarks | ||
|
||
- name: Run benchmarks | ||
run: "vendor/bin/phpbench run --php-config='opcache.enable_cli: true' tests/benchmarks --report=test --ref=main" |