-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |