|
| 1 | +name: Integration Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - 'src/*/doc/**' |
| 7 | + - 'src/**/*.md' |
| 8 | + pull_request: |
| 9 | + paths-ignore: |
| 10 | + - 'src/*/doc/**' |
| 11 | + - 'src/**/*.md' |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +env: |
| 18 | + REQUIRED_PHP_EXTENSIONS: 'mongodb' |
| 19 | + |
| 20 | +jobs: |
| 21 | + php: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + php-version: ['8.2', '8.3', '8.4'] |
| 27 | + dependency-version: [''] |
| 28 | + symfony-version: [''] |
| 29 | + include: |
| 30 | + # lowest deps |
| 31 | + - php-version: '8.2' |
| 32 | + dependency-version: 'lowest' |
| 33 | + # LTS version of Symfony |
| 34 | + - php-version: '8.2' |
| 35 | + symfony-version: '6.4.*' |
| 36 | + services: |
| 37 | + mariadb: |
| 38 | + image: mariadb:11.7 |
| 39 | + env: |
| 40 | + MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1 |
| 41 | + MARIADB_DATABASE: my_database |
| 42 | + ports: |
| 43 | + - '3309:3306' |
| 44 | + |
| 45 | + postgres: |
| 46 | + image: pgvector/pgvector:0.8.0-pg17 |
| 47 | + env: |
| 48 | + POSTGRES_DB: my_database |
| 49 | + POSTGRES_USER: postgres |
| 50 | + POSTGRES_PASSWORD: postgres |
| 51 | + ports: |
| 52 | + - '5432:5432' |
| 53 | + |
| 54 | + meilisearch: |
| 55 | + image: getmeili/meilisearch:v1.15 |
| 56 | + env: |
| 57 | + MEILI_MASTER_KEY: '${MEILISEARCH_MASTER_KEY:-changeMe}' |
| 58 | + ports: |
| 59 | + - '7700:7700' |
| 60 | + |
| 61 | + qdrant: |
| 62 | + image: qdrant/qdrant |
| 63 | + env: |
| 64 | + QDRANT__SERVICE__API_KEY: '${QDRAT_SERVICE_API_KEY:-changeMe}' |
| 65 | + ports: |
| 66 | + - '6333:6333' |
| 67 | + |
| 68 | + surrealdb: |
| 69 | + image: surrealdb/surrealdb:v2 |
| 70 | + options: |
| 71 | + >- |
| 72 | + start --user symfony --pass symfony |
| 73 | + env: |
| 74 | + SURREAL_HTTP_MAX_KEY_BODY_SIZE: 49152 |
| 75 | + ports: |
| 76 | + - '8000:8000' |
| 77 | + |
| 78 | + neo4j: |
| 79 | + image: neo4j |
| 80 | + env: |
| 81 | + NEO4J_AUTH: 'neo4j/${NEO4J_PASSWORD:-symfonyai}' |
| 82 | + ports: |
| 83 | + - '7474:7474' |
| 84 | + - '7687:7687' |
| 85 | + |
| 86 | + env: |
| 87 | + SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }} |
| 88 | + |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + |
| 92 | + - name: Configure environment |
| 93 | + run: | |
| 94 | + echo COLUMNS=120 >> $GITHUB_ENV |
| 95 | + echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV |
| 96 | + echo PHPUNIT='vendor/bin/phpunit' >> $GITHUB_ENV |
| 97 | + [ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak |
| 98 | +
|
| 99 | + PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ') |
| 100 | + echo "Packages: $PACKAGES" |
| 101 | + echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV |
| 102 | +
|
| 103 | + - name: Setup PHP |
| 104 | + uses: shivammathur/setup-php@v2 |
| 105 | + with: |
| 106 | + php-version: ${{ matrix.php-version }} |
| 107 | + tools: flex |
| 108 | + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" |
| 109 | + |
| 110 | + - name: Get composer cache directory |
| 111 | + id: composer-cache |
| 112 | + run: | |
| 113 | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 114 | +
|
| 115 | + - name: Cache packages dependencies |
| 116 | + uses: actions/cache@v4 |
| 117 | + with: |
| 118 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 119 | + key: ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}-${{ hashFiles('src/**/composer.json') }} |
| 120 | + restore-keys: | |
| 121 | + ${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }} |
| 122 | +
|
| 123 | + - name: Install root dependencies |
| 124 | + uses: ramsey/composer-install@v3 |
0 commit comments