Skip to content

Commit

Permalink
Fix composer for phpsq
Browse files Browse the repository at this point in the history
  • Loading branch information
e-spin committed May 17, 2023
1 parent cb8e667 commit f9773f1
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 34 deletions.
68 changes: 47 additions & 21 deletions .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,76 @@
name: DC General Contao Frontend
name: Code Quality Diagnostics

on:
push:
pull_request:
push:
branches:

jobs:
build:
runs-on: ubuntu-latest
name: 'PHP: ${{ matrix.php }} Contao: ${{ matrix.contao }}'
strategy:
fail-fast: false
matrix:
php: [8.1]
contao: [~4.13.0]
include:
- php: '8.1'
output: '-o github-action -o default'
phpcq_install: 'update'
contao: '~4.13.0'

steps:
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Pull source
- name: Pull source
uses: actions/checkout@v2
with:
fetch-depth: 0

# see https://github.com/shivammathur/setup-php
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Setup PHP.
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache composer cache directory
# setup caches
- name: Cache composer cache directory
uses: actions/cache@v1
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-build-${{ env.cache-name }}
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}

- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Cache vendor directory
uses: actions/cache@v3
- name: Cache vendor directory
uses: actions/cache@v1
env:
cache-name: composer-vendor
cache-name: vendor
with:
path: vendor
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.php }}-${{ matrix.contao }}-build-${{ env.cache-name }}-
- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Install composer dependencies
run: composer update --prefer-dist --no-interaction --no-suggest
- name: Cache phpcq directory
uses: actions/cache@v1
env:
cache-name: phpcq
with:
path: .phpcq
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
# install dependencies and tools
- name: Install composer dependencies
run: |
composer require contao/core-bundle ${{ matrix.contao }} --no-update
composer install
- name: Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v

- name: PHP ${{ matrix.php }} ${{ matrix.contao }} Run tests
run: ant -keep-going
# run tests
- name: Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}

- name: Upload build directory to artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.contao }}
path: .phpcq/build/
12 changes: 0 additions & 12 deletions build.xml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"source":"https://github.com/contao-community-alliance/dc-general-contao-frontend"
},
"require": {
"php": "^8.0",
"php": "^8.1",
"contao-community-alliance/dc-general": "^2.3@dev",
"contao-community-alliance/url-builder": "~1.3",
"contao-community-alliance/translator": "^2.3",
Expand Down
15 changes: 15 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<ignoreFiles>
<directory name="src/Resources"/>
</ignoreFiles>
</projectFiles>
</psalm>

0 comments on commit f9773f1

Please sign in to comment.