diff --git a/.gitea/actions.yml b/.gitea/actions.yml new file mode 100644 index 0000000..1df7eb5 --- /dev/null +++ b/.gitea/actions.yml @@ -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