Skip to content

Add Git history check workflow #26

Add Git history check workflow

Add Git history check workflow #26

name: "Code style & tests"
on:
pull_request:
# Run this workflow for all PRs against main
branches:
- main
jobs:
php-check:
runs-on: ubuntu-latest
strategy:
matrix:
composer-command:
- name: PHP Code Style
command: 'style:php'
- name: Composer normalize
command: 'normalize --dry-run'
- name: PHPStan
command: analyze:php
- name: PHPUnit
command: test:php
directory: ['extension-installer', 'fractor', 'fractor-xml', 'typo3-fractor']
exclude:
- directory: extension-installer
composer-command: {name: 'PHPUnit', command: 'test:php'}
name: ${{ matrix.composer-command.name }}/${{ matrix.directory }}
defaults:
run:
working-directory: ${{ matrix.directory }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install composer dependencies
uses: php-actions/composer@v6
with:
container_workdir: /app/${{ matrix.directory }}
memory_limit: 512M
- name: 'Run check "${{ matrix.composer-command.name }}"'
uses: php-actions/composer@v6
with:
container_workdir: /app/${{ matrix.directory }}
command: ${{ matrix.composer-command.command }}
memory_limit: 512M
tests:
runs-on: ubuntu-latest
name: End to end tests
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Run tests
working-directory: tests
run: ./run-test.sh