Merge pull request #52 from fairpm/dependabot/npm_and_yarn/minimatch-… #83
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: PHP Test Suite | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: # added using https://github.com/step-security/secure-repo | |
| contents: read | |
| jobs: | |
| php-test: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| php-versions: [ '8.4' ] | |
| services: | |
| postgres: | |
| image: postgres:latest | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: aspirecloud_testing | |
| ports: | |
| - 5432/tcp | |
| options: --health-cmd pg_isready --health-interval 2s --health-timeout 2s --health-retries 10 | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@7bf05c6b704e0b9bfee22300130a31b5ea68d593 # v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: mbstring, pgsql | |
| # not doing coverage in CI yet | |
| # coverage: xdebug | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: composer install | |
| - name: Prepare tests | |
| run: | | |
| cp .env.example .env | |
| php artisan key:generate | |
| php artisan migrate | |
| env: | |
| CACHE_STORE: array | |
| DB_HOST: localhost | |
| DB_PORT: ${{ job.services.postgres.ports[5432] }} | |
| DB_USERNAME: postgres | |
| DB_PASSWORD: postgres | |
| DB_DATABASE: aspirecloud_testing | |
| - name: Run Pest | |
| run: vendor/bin/pest --ci | |
| env: | |
| CACHE_STORE: array | |
| DB_HOST: localhost | |
| DB_PORT: ${{ job.services.postgres.ports[5432] }} | |
| DB_USERNAME: postgres | |
| DB_PASSWORD: postgres | |
| DB_DATABASE: aspirecloud_testing | |