Skip to content

Commit a9bed9c

Browse files
authored
Merge pull request #18 from DAGpro/support-8-4-php
PHP 8.1 - 8.4 support
2 parents 5c2b797 + e313305 commit a9bed9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+307
-363
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@ insert_final_newline = true
77
indent_style = space
88
indent_size = 4
99
trim_trailing_whitespace = true
10+
11+
[*.yml]
12+
indent_size = 2
13+
14+
[*.yaml]
15+
indent_size = 2
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[Makefile]
21+
indent_style = tab

.gitattributes

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
/tests export-ignore
1+
* text=auto
2+
3+
/.* export-ignore
4+
/tests/ export-ignore
5+
6+
/*.xml export-ignore
7+
/*.xml.dist export-ignore

.github/workflows/cs-fix.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on:
2+
push:
3+
branches:
4+
- '*'
5+
6+
name: Fix Code Style
7+
8+
jobs:
9+
cs-fix:
10+
permissions:
11+
contents: write
12+
uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master

.github/workflows/main.yml

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,26 @@ name: build
33
on:
44
push:
55
pull_request:
6-
schedule:
7-
- cron: '0 0 * * *'
86

97
jobs:
108
test:
11-
name: Build (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
9+
name: Build (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.dependencies }})
1210
runs-on: ${{ matrix.os }}
1311

1412
strategy:
1513
fail-fast: false
1614
matrix:
17-
php: [ '7.4', '8.0', '8.1' ]
15+
php: ['8.1', '8.2', '8.3', '8.4']
1816
os: [ ubuntu-latest ]
19-
stability: [ prefer-lowest, prefer-stable ]
17+
dependencies: [ lowest, highest ]
2018

2119
steps:
2220
- name: Set Git To Use LF
2321
run: |
2422
git config --global core.autocrlf false
2523
git config --global core.eol lf
2624
- name: Checkout
27-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2826

2927
# Install PHP Dependencies
3028
- name: Setup PHP ${{ matrix.php }}
@@ -36,38 +34,30 @@ jobs:
3634
coverage: pcov
3735
tools: pecl
3836
ini-values: "memory_limit=-1"
39-
- name: Validate Composer
40-
run: composer validate
41-
- name: Get Composer Cache Directory
42-
# Docs: <https://github.com/actions/cache/blob/master/examples.md#php---composer>
43-
id: composer-cache
44-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
45-
- name: Restore Composer Cache
46-
uses: actions/cache@v2
47-
with:
48-
path: ${{ steps.composer-cache.outputs.dir }}
49-
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.stability }}-composer-${{ hashFiles('**/composer.json') }}
50-
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
5137

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

56-
- name: Install dependencies with composer php 8.2
57-
if: matrix.php-version == '8.2'
58-
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi --ignore-platform-reqs
41+
- name: Validate composer.json and composer.lock
42+
run: composer validate --ansi --strict
43+
44+
- name: Install dependencies with composer
45+
uses: ramsey/composer-install@v3
46+
with:
47+
dependency-versions: ${{ matrix.dependencies }}
5948

60-
# Execution
6149
- name: Execute Tests
6250
run: vendor/bin/phpunit --coverage-clover=coverage.clover
63-
- name: Upload Coverage To Codecov
64-
uses: codecov/codecov-action@v1
51+
52+
- name: Upload Coverage to Codecov
53+
uses: codecov/codecov-action@v3
6554
with:
6655
token: ${{ secrets.CODECOV_TOKEN }}
6756
file: ./coverage.clover
6857
fail_ci_if_error: false
69-
- name: Upload coverage to Scrutinizer
70-
continue-on-error: true # if is fork
58+
59+
- name: Upload Coverage to Scrutinizer
60+
continue-on-error: true
7161
uses: sudo-bot/action-scrutinizer@latest
7262
with:
73-
cli-args: "--format=php-clover coverage.clover"
63+
cli-args: "--format=php-clover coverage.clover"

.github/workflows/static.yml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,36 @@ name: static analysis
33
on:
44
pull_request:
55
push:
6-
schedule:
7-
- cron: '0 0 * * *'
86

97
jobs:
10-
mutation:
11-
name: PHP ${{ matrix.php }}-${{ matrix.os }}
12-
8+
static-analysis:
9+
name: PHP ${{ matrix.php }} - ${{ matrix.os }}
1310
runs-on: ${{ matrix.os }}
1411

1512
strategy:
1613
matrix:
17-
os:
18-
- ubuntu-latest
19-
20-
php:
21-
- "8.0"
14+
php: [8.3]
15+
os: [ubuntu-latest]
2216

2317
steps:
2418
- name: Checkout
25-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2620

27-
- name: Install PHP
21+
- name: Install PHP ${{ matrix.php }}
2822
uses: shivammathur/setup-php@v2
2923
with:
30-
php-version: "${{ matrix.php }}"
31-
tools: composer:v2, cs2pr
24+
php-version: ${{ matrix.php }}
25+
ini-values: error_reporting=E_ALL
3226
coverage: none
3327

34-
- name: Determine composer cache directory
35-
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
36-
37-
- name: Cache dependencies installed with composer
38-
uses: actions/cache@v2
39-
with:
40-
path: ${{ env.COMPOSER_CACHE_DIR }}
41-
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
42-
restore-keys: |
43-
php${{ matrix.php }}-composer-
28+
- name: Setup problem matchers
29+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
4430

45-
- name: Update composer
46-
run: composer self-update
31+
- name: Validate composer.json and composer.lock
32+
run: composer validate --ansi --strict
4733

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

51-
- name: Static analysis
52-
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle --php-version=8.0 | cs2pr --graceful-warnings --colorize
37+
- name: Run Psalm Static Analysis
38+
run: composer psalm:ci

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/.idea
22
/composer.lock
33
/vendor
4-
/.phpunit.result.cache
4+
/runtime

.php-cs-fixer.dist.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
require_once 'vendor/autoload.php';
6+
7+
return \Spiral\CodeStyle\Builder::create()
8+
->include(__DIR__ . '/src')
9+
->include(__FILE__)
10+
->allowRisky(true)
11+
->build();

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build:
1414
nodes:
1515
analysis:
1616
environment:
17-
php: 8.0
17+
php: 8.1
1818

1919
tests:
2020
override:

.styleci.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

composer.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
"license": "MIT",
55
"description": "Utils for Cycle ORM Schema rendering",
66
"require": {
7-
"php": ">=7.4",
8-
"cycle/orm": "1.2 - 2"
7+
"php": ">=8.1",
8+
"cycle/orm": "^2.0",
9+
"symfony/polyfill-php83": "^1.31.0"
910
},
1011
"require-dev": {
11-
"phpunit/phpunit": "^9.5",
12-
"spiral/code-style": "^1.0",
13-
"vimeo/psalm": "^4.10|^5.1"
12+
"phpunit/phpunit": "^10.5",
13+
"spiral/code-style": "^2.2.2",
14+
"spiral/dumper": "^3.3",
15+
"vimeo/psalm": "^5.26.1 || ^6.8.9"
1416
},
1517
"autoload": {
1618
"psr-4": {
@@ -23,11 +25,12 @@
2325
}
2426
},
2527
"scripts": {
26-
"test": [
27-
"phpcs --standard=phpcs.xml",
28-
"psalm --no-cache",
29-
"phpunit"
30-
]
28+
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
29+
"cs:fix": "php-cs-fixer fix -v",
30+
"psalm": "psalm",
31+
"psalm:ci": "psalm --output-format=github --shepherd --show-info=false --stats --threads=4",
32+
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
33+
"test": "phpunit --color=always"
3134
},
3235
"config": {
3336
"sort-packages": true

0 commit comments

Comments
 (0)