Skip to content

Caricamento dati + fix template vari #144

Caricamento dati + fix template vari

Caricamento dati + fix template vari #144

Workflow file for this run

name: 'PHP'
on:
pull_request: {}
push:
branches:
- main
jobs:
cs:
name: 'Run PHPCS'
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v4'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '8.2'
tools: 'composer'
extensions: 'mbstring, intl'
coverage: 'none'
- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "path=$(composer global config cache-dir)" >> $GITHUB_OUTPUT'
- name: 'Share Composer cache across runs'
uses: 'actions/cache@v4'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ github.job }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ github.job }}-
composer-
- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction'
- name: 'Run PHP CodeSniffer'
run: composer run-script cs-check -- -n
stan:
name: 'Run PHP STAN'
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v4'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '8.2'
tools: 'composer'
extensions: 'mbstring, intl'
coverage: 'none'
- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "path=$(composer global config cache-dir)" >> $GITHUB_OUTPUT'
- name: 'Share Composer cache across runs'
uses: 'actions/cache@v4'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ github.job }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ github.job }}-
composer-
- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction'
- name: 'Configure app'
run: 'cp config/app_local.example.php config/app_local.php '
- name: 'Run PHP STAN'
run: composer run-script stan
unit:
name: 'Run unit tests'
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
php:
- '8.2'
mysql:
- '8.0'
env:
PHP_VERSION: '${{ matrix.php }}'
MYSQL_VERSION: '${{ matrix.mysql }}'
DATABASE_TEST_URL: 'mysql://bedita:[email protected]:3306/bedita?realVendor=mysql${{ matrix.mysql }}'
services:
db:
image: 'mysql:${{ matrix.mysql }}'
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_USER: 'bedita'
MYSQL_PASSWORD: 'bedita'
MYSQL_DATABASE: 'bedita'
ports:
- '3306:3306'
options: '--health-cmd "mysqladmin ping -h localhost" --health-interval 10s --health-timeout 5s --health-retries 5'
steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v4'
- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
tools: 'composer'
extensions: 'mbstring, intl, pdo_mysql'
coverage: 'none' # Using PHPDBG
- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "path=$(composer global config cache-dir)" >> $GITHUB_OUTPUT'
- name: 'Share Composer cache across runs'
uses: 'actions/cache@v4'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-${{ matrix.php }}-
composer-
- name: 'Install dependencies with Composer'
run: 'composer install --prefer-dist --no-interaction'
- name: 'Configure app'
run: 'cp config/app_local.example.php config/app_local.php '
- name: 'Run PHPUnit'
run: 'phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml'
- name: 'Export coverage results'
uses: 'codecov/codecov-action@v4'
with:
file: './clover.xml'
env_vars: PHP_VERSION,MYSQL_VERSION
- name: 'Archive code coverage results'
uses: 'actions/upload-artifact@v4'
with:
name: 'PHP ${{ matrix.php }} with MySQL ${{ matrix.mysql }}'
path: 'clover.xml'