Update checkout action runtime #49
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] | |
| pull_request: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Validate root composer.json | |
| run: composer validate --strict | |
| - name: Validate package composer.json files | |
| run: composer validate:packages | |
| - name: Check package architecture | |
| run: composer architecture | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [8.2, 8.3, 8.4] | |
| package: | |
| - packages/api-resource | |
| - packages/framework | |
| - packages/support | |
| - packages/http | |
| - packages/http-client | |
| - packages/logging | |
| - packages/mail | |
| - packages/queue | |
| - packages/scheduler | |
| - packages/router | |
| - packages/view | |
| - packages/view-php | |
| - packages/view-ssr | |
| - packages/razor | |
| - packages/cache | |
| - packages/config | |
| - packages/env | |
| - packages/events | |
| - packages/database | |
| - packages/session | |
| - packages/auth | |
| - packages/errors | |
| - packages/filesystem | |
| - packages/validation | |
| - packages/security | |
| - packages/dumper | |
| - packages/ssr-bridge | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| tools: composer:v2 | |
| - name: Validate composer.json | |
| working-directory: ${{ matrix.package }} | |
| run: composer validate --strict --no-check-lock | |
| - name: Configure monorepo path repository | |
| working-directory: ${{ matrix.package }} | |
| run: | | |
| composer config minimum-stability dev | |
| composer config prefer-stable true | |
| composer config repositories.monorepo '{"type":"path","url":"../*","canonical":true,"options":{"symlink":true}}' | |
| - name: Install dependencies | |
| working-directory: ${{ matrix.package }} | |
| run: composer update --prefer-dist --no-progress --no-interaction | |
| - name: Run tests | |
| working-directory: ${{ matrix.package }} | |
| run: | | |
| if [ -f phpunit.xml.dist ]; then | |
| composer test | |
| fi | |
| - name: Run static analysis | |
| working-directory: ${{ matrix.package }} | |
| run: | | |
| if composer run-script --list | grep -q '^ analyse '; then | |
| composer analyse | |
| fi | |
| if composer run-script --list | grep -q '^ psalm '; then | |
| composer psalm | |
| fi | |
| - name: Audit dependencies | |
| working-directory: ${{ matrix.package }} | |
| run: composer audit --no-interaction | |
| ecosystem: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [8.2, 8.3, 8.4] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| extensions: pdo_sqlite | |
| tools: composer:v2 | |
| - name: Install skeleton dependencies | |
| run: composer install:ecosystem | |
| - name: Run ecosystem acceptance suite | |
| run: composer test:ecosystem | |
| integration-mysql: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:8.4 | |
| env: | |
| MYSQL_DATABASE: annabel_test | |
| MYSQL_USER: annabel | |
| MYSQL_PASSWORD: annabel | |
| MYSQL_ROOT_PASSWORD: root | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1 -uannabel -pannabel" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| extensions: pdo_mysql | |
| tools: composer:v2 | |
| - name: Configure monorepo path repository | |
| working-directory: packages/security | |
| run: | | |
| composer config minimum-stability dev | |
| composer config prefer-stable true | |
| composer config repositories.monorepo '{"type":"path","url":"../*","canonical":true,"options":{"symlink":true}}' | |
| - name: Install security dependencies | |
| working-directory: packages/security | |
| run: composer update --prefer-dist --no-progress --no-interaction | |
| - name: Run MySQL throttle integration test | |
| working-directory: packages/security | |
| env: | |
| MYSQL_HOST: 127.0.0.1 | |
| MYSQL_PORT: 3306 | |
| MYSQL_DATABASE: annabel_test | |
| MYSQL_USERNAME: annabel | |
| MYSQL_PASSWORD: annabel | |
| run: vendor/bin/phpunit --filter DatabaseThrottleStorageTest --fail-on-skipped --fail-on-deprecation | |
| integration-redis: | |
| runs-on: ubuntu-latest | |
| services: | |
| redis: | |
| image: redis:7.4-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| coverage: none | |
| extensions: redis | |
| tools: composer:v2 | |
| - name: Configure security path repository | |
| working-directory: packages/security | |
| run: | | |
| composer config minimum-stability dev | |
| composer config prefer-stable true | |
| composer config repositories.monorepo '{"type":"path","url":"../*","canonical":true,"options":{"symlink":true}}' | |
| - name: Install security dependencies | |
| working-directory: packages/security | |
| run: composer update --prefer-dist --no-progress --no-interaction | |
| - name: Run Redis throttle integration test | |
| working-directory: packages/security | |
| env: | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: 6379 | |
| REDIS_DB: 0 | |
| run: vendor/bin/phpunit --filter RedisThrottleStorageTest --fail-on-skipped --fail-on-deprecation | |
| - name: Configure session path repository | |
| working-directory: packages/session | |
| run: | | |
| composer config minimum-stability dev | |
| composer config prefer-stable true | |
| composer config repositories.monorepo '{"type":"path","url":"../*","canonical":true,"options":{"symlink":true}}' | |
| - name: Install session dependencies | |
| working-directory: packages/session | |
| run: composer update --prefer-dist --no-progress --no-interaction | |
| - name: Run Redis session integration test | |
| working-directory: packages/session | |
| env: | |
| REDIS_TESTS: 1 | |
| REDIS_HOST: 127.0.0.1 | |
| REDIS_PORT: 6379 | |
| run: vendor/bin/phpunit --filter RedisSessionHandlerIntegrationTest --fail-on-skipped --fail-on-deprecation |