Files
Investidor-V2/.github/workflows/tests.yml
nala 287e991486
tests / ci (push) Waiting to run
oportunidades 7
2026-10-13 11:40:29 +02:00

81 lines
2.2 KiB
YAML

name: tests
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:17-3.5
env:
POSTGRES_DB: investmoz_test
POSTGRES_USER: investmoz_test
POSTGRES_PASSWORD: test-only-password
ports:
- 55441:5432
options: >-
--health-cmd "pg_isready -U investmoz_test -d investmoz_test"
--health-interval 10s --health-timeout 5s --health-retries 5
env:
APP_ENV: testing
DB_CONNECTION: pgsql
DB_HOST: 127.0.0.1
DB_PORT: 55441
DB_DATABASE: investmoz_test
DB_USERNAME: investmoz_test
DB_PASSWORD: test-only-password
MAIL_MAILER: array
CACHE_STORE: array
SESSION_DRIVER: array
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.5'
extensions: pdo_pgsql, intl, mbstring
tools: composer:v2
coverage: none
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'
- name: Setup Application
run: |
composer install --no-interaction --prefer-dist
cp .env.example .env
php artisan key:generate
npm ci
npm run build
- name: Prevent accidental diagnostic exposure (C132)
run: |
php tools/portal-diagnostics-deployment-guard.php --self-test
php tools/portal-diagnostics-deployment-guard.php
- name: Run CI Checks
run: composer ci:check
- name: Validate PostgreSQL/PostGIS schema lifecycle
env:
INVESTMOZ_SCHEMA_TESTS: '1'
run: php vendor/bin/phpunit --configuration=phpunit.investmoz.xml --do-not-cache-result
- name: Test all frontend contracts and calculators
run: node --test tests/frontend/*.test.mjs