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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
8 changes: 7 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
/tests export-ignore
* text=auto

/.* export-ignore
/tests/ export-ignore

/*.xml export-ignore
/*.xml.dist export-ignore
12 changes: 12 additions & 0 deletions .github/workflows/cs-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
push:
branches:
- '*'

name: Fix Code Style

jobs:
cs-fix:
permissions:
contents: write
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master
50 changes: 20 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,26 @@ name: build
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
test:
name: Build (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
name: Build (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.dependencies }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1' ]
php: ['8.1', '8.2', '8.3', '8.4']
os: [ ubuntu-latest ]
stability: [ prefer-lowest, prefer-stable ]
dependencies: [ lowest, highest ]

steps:
- name: Set Git To Use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

# Install PHP Dependencies
- name: Setup PHP ${{ matrix.php }}
Expand All @@ -36,38 +34,30 @@ jobs:
coverage: pcov
tools: pecl
ini-values: "memory_limit=-1"
- name: Validate Composer
run: composer validate
- name: Get Composer Cache Directory
# Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-

- name: Install dependencies with composer
if: matrix.php-version != '8.2'
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Setup problem matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi --ignore-platform-reqs
- name: Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: Install dependencies with composer
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}

# Execution
- name: Execute Tests
run: vendor/bin/phpunit --coverage-clover=coverage.clover
- name: Upload Coverage To Codecov
uses: codecov/codecov-action@v1

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.clover
fail_ci_if_error: false
- name: Upload coverage to Scrutinizer
continue-on-error: true # if is fork

- name: Upload Coverage to Scrutinizer
continue-on-error: true
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover coverage.clover"
cli-args: "--format=php-clover coverage.clover"
44 changes: 15 additions & 29 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,36 @@ name: static analysis
on:
pull_request:
push:
schedule:
- cron: '0 0 * * *'

jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

static-analysis:
name: PHP ${{ matrix.php }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- "8.0"
php: [8.3]
os: [ubuntu-latest]

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

- name: Install PHP
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: composer:v2, cs2pr
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL
coverage: none

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Setup problem matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Update composer
run: composer self-update
- name: Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: Install dependencies with composer
run: composer update --with cycle/orm:^2.0 --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
uses: ramsey/composer-install@v3

- name: Static analysis
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle --php-version=8.0 | cs2pr --graceful-warnings --colorize
- name: Run Psalm Static Analysis
run: composer psalm:ci
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.idea
/composer.lock
/vendor
/.phpunit.result.cache
/runtime
11 changes: 11 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

require_once 'vendor/autoload.php';

return \Spiral\CodeStyle\Builder::create()
->include(__DIR__ . '/src')
->include(__FILE__)
->allowRisky(true)
->build();
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
nodes:
analysis:
environment:
php: 8.0
php: 8.1

tests:
override:
Expand Down
81 changes: 0 additions & 81 deletions .styleci.yml

This file was deleted.

23 changes: 13 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"license": "MIT",
"description": "Utils for Cycle ORM Schema rendering",
"require": {
"php": ">=7.4",
"cycle/orm": "1.2 - 2"
"php": ">=8.1",
"cycle/orm": "^2.0",
"symfony/polyfill-php83": "^1.31.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"spiral/code-style": "^1.0",
"vimeo/psalm": "^4.10|^5.1"
"phpunit/phpunit": "^10.5",
"spiral/code-style": "^2.2.2",
"spiral/dumper": "^3.3",
"vimeo/psalm": "^5.26.1 || ^6.8.9"
},
"autoload": {
"psr-4": {
Expand All @@ -23,11 +25,12 @@
}
},
"scripts": {
"test": [
"phpcs --standard=phpcs.xml",
"psalm --no-cache",
"phpunit"
]
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
"cs:fix": "php-cs-fixer fix -v",
"psalm": "psalm",
"psalm:ci": "psalm --output-format=github --shepherd --show-info=false --stats --threads=4",
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
"test": "phpunit --color=always"
},
"config": {
"sort-packages": true
Expand Down
45 changes: 0 additions & 45 deletions phpcs.xml

This file was deleted.

Loading
Loading