From defe6c1ac462fb1566e4c34d764de2e54526fcb3 Mon Sep 17 00:00:00 2001 From: Ondrej Vlach Date: Thu, 12 Feb 2026 09:39:29 +0100 Subject: [PATCH] ci: add workflow for gitea --- .gitea/workflows/tests.yml | 121 +++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 .gitea/workflows/tests.yml diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml new file mode 100644 index 0000000..b6ac986 --- /dev/null +++ b/.gitea/workflows/tests.yml @@ -0,0 +1,121 @@ +name: Tests + +on: + push: + branches: + - "*" + pull_request: + +jobs: + build-npm: + runs-on: ubuntu-latest + container: + image: node:20-slim + steps: + - name: Checkout + uses: https://github.com/actions/checkout.git@v4 + - name: NPM install + run: npm install + - name: NPM run build + run: npm run build + - uses: https://gitea.com/actions/upload-artifact.git@v3 + name: Upload resources + id: artifact-upload-step + with: + name: nodejs-artefacts + path: | + public/build/ + + tests: + runs-on: ubuntu-latest + container: + image: git.nanobyte.cz/ovlach-public/php-docker:php-fpm-dev-8.4.17-cad44e8 + services: + postgresql-test: + image: postgres:17-alpine + env: + POSTGRES_DB: ecomail + POSTGRES_USER: laravel + POSTGRES_PASSWORD: laravel + options: >- + --health-cmd "pg_isready -U laravel -d ecomail" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + APP_ENV: testing + APP_DEBUG: true + APP_KEY: base64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= + DB_CONNECTION: pgsql + DB_HOST: postgresql-test + DB_PORT: 5432 + DB_DATABASE: ecomail + DB_USERNAME: laravel + DB_PASSWORD: laravel + DB_URL: pgsql://laravel:laravel@postgresql-test:5432/ecomail + CACHE_STORE: array + SESSION_DRIVER: array + QUEUE_CONNECTION: sync + MAIL_MAILER: array + + needs: + - build-npm + + steps: + - name: Checkout + uses: https://github.com/actions/checkout.git@v4 + + - uses: https://gitea.com/actions/download-artifact.git@v3 + id: artifact-download-step-resources + name: Download nodejs-artefacts + with: + name: nodejs-artefacts + path: public/build/ + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Run migrations + run: php artisan migrate --force --no-interaction + + - name: Run tests + run: php artisan test --compact + + validate-composer: + runs-on: ubuntu-latest + container: + image: git.nanobyte.cz/ovlach-public/php-docker:php-fpm-dev-8.4.17-cad44e8 + steps: + - name: Checkout + uses: https://github.com/actions/checkout.git@v4 + + - name: Validate composer.json + run: composer validate --strict + + phpcs: + runs-on: ubuntu-latest + container: + image: git.nanobyte.cz/ovlach-public/php-docker:php-fpm-dev-8.4.17-cad44e8 + steps: + - name: Checkout + uses: https://github.com/actions/checkout.git@v4 + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Run PHPCS + run: vendor/bin/phpcs + + phpstan: + runs-on: ubuntu-latest + container: + image: git.nanobyte.cz/ovlach-public/php-docker:php-fpm-dev-8.4.17-cad44e8 + steps: + - name: Checkout + uses: https://github.com/actions/checkout.git@v4 + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Run PHPStan + run: vendor/bin/phpstan analyze --memory-limit=2G