Agrega configuración de CI/CD para PHP

This commit is contained in:
David Vargas 2024-09-05 13:19:31 -06:00
parent 31e66fb310
commit 9a8cf9a387

38
.gitea/actions.yml Normal file
View File

@ -0,0 +1,38 @@
name: CI/CD Pipeline for PHP
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
tools: composer
- name: Install dependencies
run: composer install
- name: Lint PHP files
run: |
composer require --dev squizlabs/php_codesniffer
./vendor/bin/phpcs --standard=PSR12 src/
- name: Run tests
run: |
if [ -f vendor/bin/phpunit ]; then
vendor/bin/phpunit --verbose
else
echo "PHPUnit no está instalado o no hay pruebas configuradas."
fi