Skip to content

Commit

Permalink
Add multilineCellDelimiter (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Aug 3, 2023
1 parent 0d6d8cb commit 1fb5cc4
Show file tree
Hide file tree
Showing 10 changed files with 512 additions and 708 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/cloc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: cloc
on:
pull_request:

# Cancel the workflow in progress in newer build is about to start.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
cloc:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: pr
- name: Checkout base code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
path: base
- name: Count Lines Of Code
id: loc
run: |
curl -sLO https://github.com/vearutop/sccdiff/releases/download/v1.0.2/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && echo "b17e76bede22af0206b4918d3b3c4e7357f2a21b57f8de9e7c9dc0eb56b676c0 sccdiff" | shasum -c
OUTPUT=$(cd pr && ../sccdiff -basedir ../base)
echo "${OUTPUT}"
OUTPUT="${OUTPUT//$'\n'/%0A}"
echo "::set-output name=diff::$OUTPUT"
- name: Comment Code Lines
continue-on-error: true
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
header: LOC
message: |
### Lines Of Code
${{ steps.loc.outputs.diff }}
38 changes: 38 additions & 0 deletions .github/workflows/test-unit-cov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: test-unit-cov
on:
push:
branches:
- master
- main
pull_request:
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ 'ubuntu-latest' ]
php-versions: [ '7.4' ]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache vendor
uses: actions/cache@v2
with:
path: |
vendor
key: deps-${{ hashFiles('composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug
tools: composer

- name: Populate vendor
run: '[ -e vendor ] || composer install'

- name: Run Tests With Coverage
run: make deps test-coverage && bash <(curl -s https://codecov.io/bash)
37 changes: 37 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test-unit
on:
push:
branches:
- master
- main
pull_request:
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ 'ubuntu-latest' ]
php-versions: [ '5.6', '7.0', '7.1', '7.2', '7.3', '8.0', '8.1', '8.2' ]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache vendor
uses: actions/cache@v2
with:
path: |
vendor
key: deps-${{ hashFiles('composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: post_max_size=256M, max_execution_time=180
tools: composer

- name: Populate vendor
run: '[ -e vendor ] || composer install'

- name: Run Tests
run: make deps test
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
PHPSTAN_VERSION ?= 0.12.43
PHPBENCH_VERSION ?= 0.16.10

deps:
@git submodule init && git submodule update

lint:
@test -f ${HOME}/.cache/composer/phpstan-${PHPSTAN_VERSION}.phar || (mkdir -p ${HOME}/.cache/composer/ && wget -q https://github.com/phpstan/phpstan/releases/download/${PHPSTAN_VERSION}/phpstan.phar -O ${HOME}/.cache/composer/phpstan-${PHPSTAN_VERSION}.phar)
@php $$HOME/.cache/composer/phpstan-${PHPSTAN_VERSION}.phar analyze -l 7 -c phpstan.neon ./src

docker-lint:
@docker run -v $$PWD:/app --rm phpstan/phpstan analyze -l 7 -c phpstan.neon ./src

test:
@php vendor/bin/phpunit --configuration phpunit.xml

docker-test-new:
@docker run -v $$PWD:/app -w /app --rm php:8.1.0RC1-zts-buster php vendor/bin/phpunit --configuration phpunit.xml

docker-test-old:
@docker run -v $$PWD:/app -w /app --rm php:5.4-cli php vendor/bin/phpunit --configuration phpunit.xml

test-coverage:
@php -derror_reporting="E_ALL & ~E_DEPRECATED" -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text --coverage-clover=coverage.xml

phpbench:
@test -f ${HOME}/.cache/composer/phpbench-${PHPBENCH_VERSION}.phar || (mkdir -p ${HOME}/.cache/composer/ && wget https://github.com/phpbench/phpbench/releases/download/${PHPBENCH_VERSION}/phpbench.phar -O ${HOME}/.cache/composer/phpbench-${PHPBENCH_VERSION}.phar)

bench: phpbench
@php $$HOME/.cache/composer/phpbench-${PHPBENCH_VERSION}.phar run benchmarks --tag=candidate --progress=none --bootstrap=vendor/autoload.php --revs=50 --iterations=5 --retry-threshold=3 --dump-file=phpbench-candidate.xml

bench-master: phpbench
@git checkout --detach && git fetch origin '+refs/heads/master:refs/heads/master' && git checkout master -- ./src
@composer install --dev --no-interaction --prefer-dist
@php $$HOME/.cache/composer/phpbench-${PHPBENCH_VERSION}.phar run benchmarks --tag=master --progress=none --bootstrap=vendor/autoload.php --revs=50 --iterations=5 --retry-threshold=3 --dump-file=phpbench-master.xml

bench-compare: phpbench
@php $$HOME/.cache/composer/phpbench-${PHPBENCH_VERSION}.phar report --file phpbench-master.xml --file phpbench-candidate.xml --report='generator: "table", cols: [ "set" ], compare: "tag", compare_fields: ["mean"], break: ["benchmark"]'
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
],
"require": {
"php": ">=5.4.0",
"psr/log": "^1.0.1",
"php-yaoi/php-yaoi": "*"
},
"require-dev": {
"codeclimate/php-test-reporter": "0.1.2",
"phpunit/phpunit": "4.8.23"
"phperf/phpunit": "4.8.37"
},
"autoload": {
"psr-4": {
Expand All @@ -33,5 +31,10 @@
},
"scripts": {
"test": "php -dxdebug.coverage_enable=1 ./vendor/bin/phpunit --coverage-text"
},
"config": {
"platform": {
"php": "5.4.45"
}
}
}
Loading

0 comments on commit 1fb5cc4

Please sign in to comment.