test: add destroy post tests for status filters and redirect param #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| DB_CONNECTION: pgsql | |
| DB_DATABASE: trypost_test | |
| DB_USERNAME: postgres | |
| DB_PASSWORD: password | |
| BROADCAST_CONNECTION: "null" | |
| CACHE_STORE: array | |
| QUEUE_CONNECTION: sync | |
| SESSION_DRIVER: array | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_DB: trypost_test | |
| ports: | |
| - 5432/tcp | |
| options: >- | |
| --health-cmd="pg_isready" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379/tcp | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, pdo_pgsql, bcmath, intl, gd, redis | |
| coverage: none | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install Composer dependencies | |
| run: composer install --no-interaction --prefer-dist --optimize-autoloader | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Build assets | |
| run: npm run build | |
| - name: Prepare environment | |
| run: | | |
| cp .env.ci .env | |
| php artisan key:generate | |
| - name: Clear Config | |
| run: php artisan config:clear | |
| - name: Run migrations | |
| run: php artisan migrate --force | |
| env: | |
| DB_PORT: ${{ job.services.postgres.ports['5432'] }} | |
| REDIS_PORT: ${{ job.services.redis.ports['6379'] }} | |
| - name: Run tests | |
| run: php artisan test --compact | |
| env: | |
| DB_PORT: ${{ job.services.postgres.ports['5432'] }} | |
| REDIS_PORT: ${{ job.services.redis.ports['6379'] }} |