Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Exclude from release archives
/.github export-ignore
/Tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Makefile export-ignore
phpstan.neon export-ignore
phpstan-baseline.neon export-ignore
phpunit.xml export-ignore
rector.php export-ignore
grumphp.yml export-ignore
fractor.php export-ignore
87 changes: 87 additions & 0 deletions .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: PHP Composer

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
name: "php: ${{ matrix.php }} TYPO3: ${{ matrix.typo3 }}"
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 4
matrix:
php: [ '82', '83', '84', '85' ]
typo3: [ '14' ]
outputs:
result: ${{ steps.set-result.outputs.result }}
php: ${{ matrix.php }}
typo3: ${{ matrix.typo3 }}
container:
image: ghcr.io/typo3/core-testing-php${{ matrix.php }}:latest
steps:
- name: Install dependencies (Alpine)
run: apk add --no-cache nodejs npm gnupg
- uses: actions/checkout@v4
- name: Get composer project name
id: composer-name
run: echo "name=$(php -r "echo str_replace('/', '-', json_decode(file_get_contents('composer.json'))->name);")" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: |
~/.composer/cache/files
vendor
node_modules
key: ${{ matrix.typo3 }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
${{ matrix.typo3 }}-${{ matrix.php }}-composer-
- run: git config --global --add safe.directory $GITHUB_WORKSPACE
- run: composer switchto${{ matrix.typo3 }} --ignore-platform-req=php+
- run: ./vendor/bin/grumphp run --ansi --no-interaction
- run: composer test
- name: Generate coverage report
if: matrix.php == '83' && matrix.typo3 == '14'
run: ./vendor/bin/phpunit --coverage-clover coverage.xml
env:
XDEBUG_MODE: coverage
- name: Upload coverage to Codecov
if: matrix.php == '83' && matrix.typo3 == '14'
uses: codecov/codecov-action@v5.5.3
continue-on-error: true
with:
files: coverage.xml
fail_ci_if_error: false
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Save result
if: always()
run: |
mkdir -p summary
echo "PHP=${{ matrix.php }} TYPO3=${{ matrix.typo3 }} RESULT=${{ job.status }}" \
>> summary/results.txt
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ steps.composer-name.outputs.name }}-${{ matrix.typo3 }}-${{ matrix.php }}
path: summary/results.txt
summary:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- uses: actions/checkout@v4
- name: Get composer project name
id: composer-name
run: echo "name=$(python3 -c "import json; d=json.load(open('composer.json')); print(d['name'].replace('/', '-'))")" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
path: summary
pattern: ${{ steps.composer-name.outputs.name }}-*
merge-multiple: false
- name: Show results
run: |
echo "### Matrix results"
find summary -name results.txt | sort | xargs cat
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ var
vendor
.phpunit.result.cache
.idea/
composer.lock
Loading
Loading