From 9a8cf9a387fb7b2f7aa958e9e4914ef3e92a8dea Mon Sep 17 00:00:00 2001 From: DavidDevGt Date: Thu, 5 Sep 2024 13:19:31 -0600 Subject: [PATCH] =?UTF-8?q?Agrega=20configuraci=C3=B3n=20de=20CI/CD=20para?= =?UTF-8?q?=20PHP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/actions.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitea/actions.yml 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