Skip to content

Merge pull request #47 from picamator/development #190

Merge pull request #47 from picamator/development

Merge pull request #47 from picamator/development #190

Workflow file for this run

name: CI
env:
PHP_VERSION: 8.5
on:
push:
branches:
- main
pull_request:
branches:
- development
- main
jobs:
setup:
name: Project Setup
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
actions: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer:v2
- name: Cache vendor directory
id: cache-vendor
uses: actions/cache@v5
with:
path: ./vendor
key: ${{ runner.os }}-composer-${{ env.PHP_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ env.PHP_VERSION }}-
- name: Install dependencies (if needed)
run: composer install --audit --no-ansi --no-interaction --no-progress
if: steps.cache-vendor.outputs.cache-hit != 'true'
- name: Validate composer.json
run: composer validate --no-ansi --strict composer.json
phpstan:
name: PHPStan
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
contents: read
actions: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer:v2
- name: Cache vendor directory
id: cache-vendor
uses: actions/cache@v5
with:
path: ./vendor
key: ${{ runner.os }}-composer-${{ env.PHP_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ env.PHP_VERSION }}-
- name: Install dependencies (if needed)
run: composer install --no-ansi --no-interaction --no-progress
if: steps.cache-vendor.outputs.cache-hit != 'true'
- name: Run PHPStan
run: composer phpstan
phpcs:
name: PHP CodeSniffer
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
contents: read
actions: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
tools: composer:v2
- name: Cache vendor directory
id: cache-vendor
uses: actions/cache@v5
with:
path: ./vendor
key: ${{ runner.os }}-composer-${{ env.PHP_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ env.PHP_VERSION }}-
- name: Install dependencies (if needed)
run: composer install --no-ansi --no-interaction --no-progress
if: steps.cache-vendor.outputs.cache-hit != 'true'
- name: Run PHP CodeSniffer
run: composer phpcs
phpunit:
name: PHPUnit Tests
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
contents: read
actions: read
strategy:
matrix:
php-version: [8.5, 8.6]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:v2
- name: Cache vendor directory
id: cache-vendor
uses: actions/cache@v5
with:
path: ./vendor
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php-version }}-
- name: Install dependencies (if needed)
run: composer install --no-ansi --no-interaction --no-progress
if: steps.cache-vendor.outputs.cache-hit != 'true'
- name: Dump composer autoload
run: composer dump-autoload
- name: Generate Transfer Objects
env:
PROJECT_ROOT: ${{ github.workspace }}
run: composer transfer-generate -- -c ./config/generator.config.yml
- name: Run PHPUnit
env:
PROJECT_ROOT: ${{ github.workspace }}
run: composer phpunit