Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
permissions:
contents: write
secrets: inherit
uses: bavix/.github/.github/workflows/changelog.yml@0.1.6
uses: bavix/.github/.github/workflows/changelog.yml@0.2.4
103 changes: 103 additions & 0 deletions .github/workflows/fixer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: fixer

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
autofix:
runs-on: ubuntu-latest

services:
clickhouse:
image: clickhouse/clickhouse-server
env:
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ports:
- 8123:8123

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: mbstring, pgsql, mysql, sqlite, redis, memcached, bcmath
coverage: pcov
env:
runner: self-hosted

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run rector-fix
run: composer rector-fix

- name: Run ecs-fix
run: composer ecs-fix

- name: Run rector-fix
run: composer rector-fix

- name: Run ecs-fix
run: composer ecs-fix

- name: Run rector
run: composer rector

- name: Run ecs
run: composer ecs

- name: Run parabench
run: composer parabench

- name: "Check if build has changed"
if: success()
id: has-changes
run: |
echo "stdout<<EOF" >> $GITHUB_OUTPUT
echo "$(git diff --stat)" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT

- name: Import GPG key
if: ${{ steps.has-changes.outputs.stdout }}
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_BOT }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ secrets.GPG_FINGERPRINT }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: Github bot
git_committer_email: bot@babichev.net

- name: "Commit files"
if: ${{ steps.has-changes.outputs.stdout }}
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
git commit -S -m "autofix" -a

- name: "Push changes"
if: ${{ steps.has-changes.outputs.stdout }}
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: git push -u origin HEAD
38 changes: 38 additions & 0 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: phpstan

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
phpstan:
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run phpstan
run: composer phpstan
85 changes: 85 additions & 0 deletions .github/workflows/phpunits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: phpunits

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
units:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: [8.2, 8.3]
laravel-versions: [^10.0, ^11.0]

services:
clickhouse:
image: clickhouse/clickhouse-server
env:
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ports:
- 8123:8123

steps:
- name: Checkout
id: git-checkout
uses: actions/checkout@v4

- name: Setup PHP
id: php-install
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, pgsql, mysql, sqlite, redis, memcached
coverage: pcov

- name: Validate composer.json and composer.lock
id: composer-validate
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
id: composer-dependencies
run: composer req --dev laravel/framework:${{ matrix.laravel-versions }} -W || composer install

- name: Check codeclimate
id: codeclimate-check
run: echo "execute=${{ matrix.php-versions == '8.2' && matrix.caches == 'array' && matrix.databases == 'testing' }}" >> $GITHUB_OUTPUT

- name: Prepare codeclimate
id: codeclimate-prepare
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
if: ${{ steps.codeclimate-check.outputs.execute == 'true' }}

- name: Prepare run test suite
id: unit-prepare
run: |
mkdir build

- name: Run test suite
id: unit-run
run: composer parabench

- name: Send coverage
id: codeclimate-send
run: |
./cc-test-reporter after-build --coverage-input-type clover --exit-code 0
bash <(curl -s https://codecov.io/bash)
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ steps.codeclimate-check.outputs.execute == 'true' }}
14 changes: 14 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Mark stale issues
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 21 days with no activity.'
days-before-stale: 21
days-before-close: 3
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/vendor
/.idea
composer.phar
/vendor/
composer.lock
tests/coverage
.idea/
build/
.phpunit.result.cache
.php_cs_cache
.phpunit.cache/
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

39 changes: 29 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@
"eloquent"
],
"require": {
"php": "^7.2|^8.0",
"laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0",
"the-tinderbox/clickhouse-builder": "^4.0|^5.0|^6.0",
"php": "^8.2",
"laravel/framework": "^10.0|^11.0",
"the-tinderbox/clickhouse-builder": "^6.1",
"ext-json": "*"
},
"require-dev": {
"infection/infection": "~0.15",
"phpunit/phpunit": "^8.0|^9.0",
"mockery/mockery": "^1.3",
"fakerphp/faker": "^1.9",
"bavix/clickhouse-php-client": "^3.0",
"bavix/clickhouse-builder": "^4.0"
"driftingly/rector-laravel": "^1.0",
"ergebnis/phpstan-rules": "^2.1",
"infection/infection": "~0.27",
"larastan/larastan": "^2.8",
"nunomaduro/collision": "^8.0",
"orchestra/testbench": "^9.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.0",
"symplify/easy-coding-standard": "^12.1",
"mockery/mockery": "^1.6",
"fakerphp/faker": "^1.23"
},
"autoload": {
"psr-4": {
Expand All @@ -40,6 +46,19 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit --stop-on-failure tests/"
"parabench":"@php ./vendor/bin/testbench package:test --coverage-xml=build/coverage-xml --log-junit=build/junit.xml",
"infect": "@php vendor/bin/infection --coverage=build --min-msi=50 -j$(nproc) --only-covering-test-cases",
"phpstan": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.neon",
"phpstan-baseline": "@php vendor/bin/phpstan analyse -vvv --memory-limit 2G -c phpstan.neon --generate-baseline phpstan.baseline.neon",
"ecs": "@php vendor/bin/ecs check",
"ecs-fix": "@php vendor/bin/ecs check --fix",
"ecs-cc": "@php vendor/bin/ecs --clear-cache",
"rector": "@php vendor/bin/rector process --dry-run",
"rector-fix": "@php vendor/bin/rector process"
},
"config": {
"allow-plugins": {
"infection/extension-installer": true
}
}
}
31 changes: 31 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $config): void {
$config->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

$config->skip([
GeneralPhpdocAnnotationRemoveFixer::class,
]);

$config->sets([
SetList::CLEAN_CODE,
SetList::SYMPLIFY,
SetList::ARRAY,
SetList::COMMON,
SetList::PSR_12,
SetList::CONTROL_STRUCTURES,
SetList::NAMESPACES,
SetList::STRICT,
SetList::PHPUNIT,
SetList::LARAVEL,
]);
};
Loading