Skip to content

Commit

Permalink
Merge f62b015 into f0065fa
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jan 21, 2021
2 parents f0065fa + f62b015 commit 898de00
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 118 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/benchmarks.yml
@@ -0,0 +1,49 @@
name: Perform Benchmarks

on:
pull_request:
paths-ignore:
- 'doc/**'
- 'mkdocs.yml'
- '*.md'
push:
paths-ignore:
- 'doc/**'
- 'mkdocs.yml'
- '*.md'

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl, readline
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-7.4-latest"
restore-keys: "php-7.4-latest"

- name: Install dependencies
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer install --no-interaction --no-progress --no-suggest
composer show
- name: Run benchmarks
shell: bash
run: "vendor/bin/phpbench run --revs=2 --iterations=2 --report=aggregate"
118 changes: 0 additions & 118 deletions .github/workflows/continuous-integration.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/cs-checks.yml
@@ -0,0 +1,49 @@
name: "Check Coding Standards"

on:
pull_request:
paths-ignore:
- 'doc/**'
- 'mkdocs.yml'
- '*.md'
push:
paths-ignore:
- 'doc/**'
- 'mkdocs.yml'
- '*.md'

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: mbstring, intl, readline
ini-values: memory_limit=-1
tools: composer:v2, cs2pr

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-7.4-latest"
restore-keys: "php-7.4-latest"

- name: Install dependencies
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer install --no-interaction --no-progress --no-suggest
composer show
- name: Run CS checks
shell: bash
run: "vendor/bin/phpcs -q --report=checkstyle | cs2pr"
100 changes: 100 additions & 0 deletions .github/workflows/unit-tests.yml
@@ -0,0 +1,100 @@
name: "Execute Unit Tests"

on:
pull_request:
paths-ignore:
- 'doc/**'
- 'mkdocs.yml'
- '*.md'
push:
paths-ignore:
- 'doc/**'
- 'mkdocs.yml'
- '*.md'

jobs:
run:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "lowest"
- "latest"
include:
- php-version: "7.4"
deps-version: "latest"
coverage: "xdebug"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, readline
ini-values: memory_limit=-1
coverage: ${{ matrix.coverage || 'none' }}
tools: composer:v2

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.deps-version }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.deps-version }}"

- name: Install dependencies (PHP 7)
if: startsWith(matrix.php-version, '7.')
env:
COVERAGE_DEPS: 'php-coveralls/php-coveralls'
DEPS: ${{ matrix.deps-version }}
COMPOSER_ARGS: "--no-interaction --no-progress --no-suggest"
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_COVERAGE: ${{ matrix.coverage || '' }}
run: |
composer install $COMPOSER_ARGS
if [[ $DEPS == 'latest' ]]; then composer update $COMPOSER_ARGS ; fi
if [[ $DEPS == 'lowest' ]]; then composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
if [[ $TEST_COVERAGE != '' ]]; then composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
composer show
- name: Install dependencies (PHP 8)
if: startsWith(matrix.php-version, '8.')
env:
COVERAGE_DEPS: 'php-coveralls/php-coveralls'
DEPS: ${{ matrix.deps-version }}
COMPOSER_ARGS: "--no-interaction --no-progress --no-suggest --ignore-platform-reqs"
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_COVERAGE: ${{ matrix.coverage || '' }}
run: |
composer install $COMPOSER_ARGS
if [[ $DEPS == 'latest' ]]; then composer update $COMPOSER_ARGS ; fi
if [[ $DEPS == 'lowest' ]]; then composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
if [[ $TEST_COVERAGE != '' ]]; then composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
composer show
- name: Setup problem matcher for PHPUnit
run: echo "::add-matcher${{ runner.tool_cache }}/phpunit.json"

- name: Run unit tests
env:
TEST_COVERAGE: ${{ matrix.coverage || '' }}
shell: bash
run: |
if [[ $TEST_COVERAGE != '' ]]; then composer test-coverage ; else composer test ; fi
- name: Upload coverage
if: matrix.coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "vendor/bin/php-coveralls -v"

0 comments on commit 898de00

Please sign in to comment.