Skip to content

Commit d159bcc

Browse files
committed
chore: update to latest alchemy version
1 parent a3380fc commit d159bcc

8 files changed

Lines changed: 119 additions & 107 deletions

File tree

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint code
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
with:
15+
ref: ${{ github.head_ref }}
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.2'
21+
extensions: json, zip, dom, curl, libxml, mbstring
22+
tools: composer:v2
23+
coverage: none
24+
25+
- name: Install PHP dependencies
26+
run: composer update --no-interaction --no-progress
27+
28+
- name: Run Linter
29+
run: composer run lint
30+
31+
- name: Commit changes
32+
uses: stefanzweifel/git-auto-commit-action@v4
33+
with:
34+
commit_message: 'chore: fix styling'

.github/workflows/php-cs-fixer.yml

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

.github/workflows/tests.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
name: Run Tests
22

3-
on: ['push', 'pull_request']
3+
on: ["push","pull_request"]
44

55
jobs:
6-
ci:
6+
tests:
77
runs-on: ${{ matrix.os }}
88
strategy:
9-
matrix:
10-
os: [ubuntu-latest, macos-latest]
11-
php: ['7.4', '8.0', '8.1', '8.2']
129
fail-fast: true
13-
max-parallel: 1
10+
matrix:
11+
os: ["ubuntu-latest"]
12+
php: ["8.4"]
1413

1514
name: PHP ${{ matrix.php }} - ${{ matrix.os }}
1615

1716
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v2
17+
- name: Checkout
18+
uses: actions/checkout@v2
2019

21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php }}
25-
tools: composer:v2
26-
coverage: xdebug
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: json, zip, dom, curl, libxml, mbstring
25+
tools: composer:v2
26+
coverage: xdebug
2727

28-
- name: Install PHP dependencies
29-
run: composer update --no-interaction --no-progress
28+
- name: Install PHP dependencies
29+
run: composer update --no-interaction --no-progress
3030

31-
- name: All Tests
32-
run: php vendor/bin/alchemy run
31+
- name: Run Tests
32+
run: composer run test -- --flags=coverage

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ Thumbs.db
1616

1717
# phpstorm
1818
.idea/*
19+
20+
# Alchemy
21+
.alchemy
22+
.phpunit.result.cache

.php_cs.dist.php

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

alchemy.config.php

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

alchemy.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
app:
2+
- src
3+
4+
tests:
5+
engine: pest
6+
parallel: true
7+
paths:
8+
- tests
9+
files:
10+
- '*.test.php'
11+
coverage:
12+
local: false
13+
actions: true
14+
15+
lint:
16+
single_quote: true
17+
phpdoc_scalar: true
18+
no_unused_imports: true
19+
unary_operator_spaces: true
20+
binary_operator_spaces: true
21+
phpdoc_var_without_name: true
22+
trailing_comma_in_multiline: true
23+
phpdoc_single_line_var_spacing: true
24+
single_trait_insert_per_statement: true
25+
not_operator_with_successor_space: false
26+
array_syntax:
27+
syntax: short
28+
ordered_imports:
29+
sort_algorithm: alpha
30+
method_argument_space:
31+
on_multiline: ensure_fully_multiline
32+
keep_multiple_spaces_after_comma: true
33+
blank_line_before_statement:
34+
statements:
35+
- try
36+
- break
37+
- throw
38+
- return
39+
- declare
40+
- continue
41+
42+
actions:
43+
run:
44+
- lint
45+
- tests
46+
os:
47+
- ubuntu-latest
48+
php:
49+
extensions: json, zip, dom, curl, libxml, mbstring
50+
versions:
51+
- '8.4'
52+
events:
53+
- push
54+
- pull_request

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,25 @@
2525
"Leaf\\": "src"
2626
},
2727
"files": [
28-
"src/functions.php"
29-
]
28+
"src/functions.php"
29+
]
3030
},
3131
"minimum-stability": "dev",
32-
"prefer-stable": true,
32+
"prefer-stable": true,
3333
"require-dev": {
34-
"leafs/alchemy": "^1.0",
34+
"leafs/alchemy": "^4.0",
3535
"friendsofphp/php-cs-fixer": "^3.14"
3636
},
3737
"scripts": {
3838
"format": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist.php --allow-risky=yes",
39-
"test": "vendor/bin/alchemy run"
39+
"test": "./vendor/bin/alchemy setup --test",
40+
"alchemy": "./vendor/bin/alchemy setup",
41+
"lint": "./vendor/bin/alchemy setup --lint",
42+
"actions": "./vendor/bin/alchemy setup --actions"
4043
},
4144
"config": {
4245
"allow-plugins": {
4346
"pestphp/pest-plugin": true
4447
}
4548
}
46-
}
49+
}

0 commit comments

Comments
 (0)