Conformance finding: polyglot harness uses stale PHP artifacts (#180) #73
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: ci | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| name: php artisan test (php ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| # Keep shared-runner pressure low while still exercising both supported | |
| # PHP versions. | |
| max-parallel: 1 | |
| matrix: | |
| php: ['8.4', '8.5'] | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: secret | |
| MYSQL_DATABASE: sample | |
| MYSQL_USER: laravel | |
| MYSQL_PASSWORD: password | |
| ports: | |
| - 3306/tcp | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1 -u root --password=secret" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379/tcp | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=3s | |
| --health-timeout=3s | |
| --health-retries=10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, intl, pdo_mysql, redis, bcmath, gd, zip | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Validate composer.json | |
| run: composer validate --strict | |
| - name: Cache Composer packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php-${{ matrix.php }}- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Prepare environment file | |
| run: cp .env.example .env | |
| - name: Generate application key | |
| run: php artisan key:generate | |
| - name: Configure service connection | |
| run: | | |
| if getent hosts mysql >/dev/null 2>&1; then | |
| echo "DB_HOST=mysql" >> "$GITHUB_ENV" | |
| echo "DB_PORT=3306" >> "$GITHUB_ENV" | |
| echo "SHARED_DB_HOST=mysql" >> "$GITHUB_ENV" | |
| echo "SHARED_DB_PORT=3306" >> "$GITHUB_ENV" | |
| echo "REDIS_HOST=redis" >> "$GITHUB_ENV" | |
| echo "REDIS_PORT=6379" >> "$GITHUB_ENV" | |
| else | |
| echo "DB_HOST=127.0.0.1" >> "$GITHUB_ENV" | |
| echo "DB_PORT=${{ job.services.mysql.ports[3306] }}" >> "$GITHUB_ENV" | |
| echo "SHARED_DB_HOST=127.0.0.1" >> "$GITHUB_ENV" | |
| echo "SHARED_DB_PORT=${{ job.services.mysql.ports[3306] }}" >> "$GITHUB_ENV" | |
| echo "REDIS_HOST=127.0.0.1" >> "$GITHUB_ENV" | |
| echo "REDIS_PORT=${{ job.services.redis.ports[6379] }}" >> "$GITHUB_ENV" | |
| fi | |
| - name: Run test suite | |
| env: | |
| DB_CONNECTION: mysql | |
| DB_DATABASE: sample | |
| DB_USERNAME: laravel | |
| DB_PASSWORD: password | |
| SHARED_DB_DATABASE: sample | |
| SHARED_DB_USERNAME: laravel | |
| SHARED_DB_PASSWORD: password | |
| REDIS_CLIENT: phpredis | |
| run: php artisan test |