Skip to content

Commit e9eaefb

Browse files
committed
Fix phpcq
1 parent a493fe6 commit e9eaefb

File tree

6 files changed

+63
-52
lines changed

6 files changed

+63
-52
lines changed

.check-author.yml

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

.github/workflows/diagnostics.yml

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,75 @@
11
name: MetaModels attribute_file
22

33
on:
4-
push:
5-
branches-ignore:
6-
- '**-translation'
74
pull_request:
5+
push:
6+
branches:
87

98
jobs:
109
build:
1110
runs-on: ubuntu-latest
11+
name: 'PHP: ${{ matrix.php }} Contao: ${{ matrix.contao }}'
1212
strategy:
13+
fail-fast: false
1314
matrix:
14-
php: [7.4]
15-
contao: [~4.9.0]
15+
php: [ '8.1', '8.2', '8.3' ]
16+
contao: [ '~4.13.0' ]
17+
phpcq_install: [ 'update' ]
18+
output: [ '-o github-action -o default' ]
1619

1720
steps:
18-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source
19-
uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
21+
- name: Pull source
22+
uses: actions/checkout@v4
2223

23-
# see https://github.com/shivammathur/setup-php
24-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Setup PHP.
24+
- name: Setup PHP with PECL extension
2525
uses: shivammathur/setup-php@v2
2626
with:
2727
php-version: ${{ matrix.php }}
28-
coverage: none
2928

30-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory
31-
uses: actions/cache@v3
29+
# setup caches
30+
- name: Cache composer cache directory
31+
uses: actions/cache@v4
3232
env:
3333
cache-name: composer-cache-dir
3434
with:
3535
path: ~/.cache/composer
36-
key: ${{ runner.os }}-build-${{ env.cache-name }}
36+
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}
3737

38-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory
39-
uses: actions/cache@v3
38+
- name: Cache vendor directory
39+
uses: actions/cache@v4
4040
env:
41-
cache-name: composer-vendor
41+
cache-name: vendor
4242
with:
4343
path: vendor
44-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
44+
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
4545
restore-keys: |
46-
${{ runner.os }}-build-${{ env.cache-name }}-
46+
${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-
4747
48-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Install composer dependencies
49-
run: composer update --prefer-dist --no-interaction --no-suggest
48+
- name: Cache phpcq directory
49+
uses: actions/cache@v4
50+
env:
51+
cache-name: phpcq
52+
with:
53+
path: .phpcq
54+
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
55+
restore-keys: |
56+
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
57+
58+
# install dependencies and tools
59+
- name: Install composer dependencies
60+
run: |
61+
composer require contao/core-bundle ${{ matrix.contao }} --no-update
62+
composer install
63+
- name: Install phpcq toolchain
64+
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v
5065

51-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Run tests
52-
run: ant -keep-going
66+
# run tests
67+
- name: Run tests
68+
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}
69+
70+
- name: Upload build directory to artifact
71+
uses: actions/upload-artifact@v4
72+
if: ${{ success() }} || ${{ failure() }}
73+
with:
74+
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.contao }}
75+
path: .phpcq/build/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Thumbs.db
99
.build/
1010
.external*/
1111
.idea/
12+
.phpcq/
1213
nbproject/
1314

1415
# composer related

.phpcq.yaml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ phpcq:
1515
psalm:
1616
version: ^1.0
1717
signed: false
18+
requirements:
19+
psalm:
20+
version: ^5.26.1
1821
composer-require-checker:
1922
version: ^1.0
2023
signed: false

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"contao-community-alliance/dc-general": "^2.3",
3636
"contao/core-bundle": "^4.13.0 <5.0",
3737
"doctrine/dbal": "^3.6.0",
38-
"metamodels/core": "^2.3@dev",
38+
"metamodels/core": "^2.3",
3939
"symfony/cache": "^5.4",
4040
"symfony/config": "^5.4",
4141
"symfony/dependency-injection": "^5.4",
@@ -49,7 +49,7 @@
4949
"contao/manager-plugin": "^2.1",
5050
"inspiredminds/contao-file-usage": "^3.0.1",
5151
"menatwork/contao-multicolumnwizard-bundle": "^3.4",
52-
"metamodels/contao-frontend-editing": "^2.3@dev",
52+
"metamodels/contao-frontend-editing": "^2.3",
5353
"phpcq/runner-bootstrap": "^1.0@dev"
5454
},
5555
"autoload": {

src/Resources/config/services.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ services:
3333
tags:
3434
- name: contao.migration
3535

36-
# MetaModels\AttributeFileBundle\FileUsage\FileUsageProvider:
37-
# public: true
38-
# arguments:
39-
# $factory: '@metamodels.factory'
40-
# $urlGenerator: '@router'
41-
# $requestStack: '@request_stack'
42-
# $csrfTokenManager: '@contao.csrf.token_manager'
43-
# $csrfTokenName: '%contao.csrf_token_name%'
44-
# tags:
45-
# - { name: contao_file_usage.provider }
36+
MetaModels\AttributeFileBundle\FileUsage\FileUsageProvider:
37+
public: true
38+
arguments:
39+
$factory: '@metamodels.factory'
40+
$urlGenerator: '@router'
41+
$requestStack: '@request_stack'
42+
$csrfTokenManager: '@contao.csrf.token_manager'
43+
$csrfTokenName: '%contao.csrf_token_name%'
44+
tags:
45+
- { name: contao_file_usage.provider }

0 commit comments

Comments
 (0)