Skip to content

Commit

Permalink
Merge pull request #63 from WyriHaximus/split-up-tests-and-benchmark-…
Browse files Browse the repository at this point in the history
…into-two-different-jobs

Split up tests and banchmark into two different jobs
  • Loading branch information
WyriHaximus committed Apr 17, 2021
2 parents 4c1527e + f73e4d7 commit d5c76e6
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- id: supported-versions-matrix
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1
test:
name: Run Tests and Code Quality on PHP ${{ matrix.php }}
name: Run Tests on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs:
- supported-versions-matrix
Expand Down Expand Up @@ -50,4 +50,41 @@ jobs:
- name: Test
run: |
./vendor/bin/phpunit --coverage-text
benchmark:
name: Run Benchmark on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
needs:
- supported-versions-matrix
strategy:
fail-fast: false
matrix:
composer: [install, "update", "update --prefer-lowest"]
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug, pcov
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Get composer action hash
id: composer-action-hash
run: printf "::set-output name=hash::%s" $(echo -n "${{ matrix.composer }}" | sha512sum)
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ steps.composer-action-hash.outputs.hash }}
- name: Install Composer dependencies
run: |
composer config --unset platform.php
composer update --lock
composer ${{ matrix.composer }} --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi
- name: Test
run: |
php benchmark/memory.php

0 comments on commit d5c76e6

Please sign in to comment.