Feat: extensible projections #3107
Workflow file for this run
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: | |
| pull_request: | |
| # Cancel in-progress jobs when a new commit is pushed | |
| concurrency: | |
| group: monorepo-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| run: | |
| name: "Monorepo" | |
| runs-on: ${{ matrix.operating-system }} | |
| strategy: | |
| fail-fast: true # Fail the entire workflow if any job fails | |
| matrix: | |
| operating-system: [ ubuntu-latest ] | |
| php-versions: [ '8.4' ] | |
| stability: [prefer-stable] | |
| services: | |
| kafka: | |
| image: apache/kafka:3.9.0 | |
| options: >- | |
| --env KAFKA_NODE_ID=0 | |
| --env KAFKA_PROCESS_ROLES=broker,controller | |
| --env [email protected]:9093 | |
| --env KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER | |
| --env KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://:9093 | |
| --env KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092 | |
| --env KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT | |
| --env KAFKA_AUTO_CREATE_TOPICS_ENABLE=true | |
| --env KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 | |
| --env KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 | |
| --env KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 | |
| --env KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 | |
| ports: | |
| - 9092:9092 | |
| rabbitmq: | |
| image: rabbitmq:3.11-management-alpine | |
| env: | |
| RABBITMQ_DEFAULT_USER: guest | |
| RABBITMQ_DEFAULT_PASS: guest | |
| ports: | |
| - 5672:5672 | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: "secret" | |
| MYSQL_USER: "ecotone" | |
| MYSQL_PASSWORD: "secret" | |
| MYSQL_DATABASE: "ecotone" | |
| DB_PORT: 3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| ports: | |
| - 3306:3306 | |
| postgres: | |
| image: simplycodedsoftware/postgres:16.1 | |
| env: | |
| POSTGRES_USER: ecotone | |
| POSTGRES_PASSWORD: secret | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| localstack: | |
| image: localstack/localstack:3.0.0 | |
| env: | |
| SERVICES: 'sqs,sns' | |
| ports: | |
| - "4566:4566" | |
| - "4510-4559:4510-4559" | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - '6379:6379' | |
| env: | |
| RABBIT_HOST: amqp://127.0.0.1:5672 | |
| SQS_DSN: sqs:?key=key&secret=secret®ion=us-east-1&endpoint=http://127.0.0.1:4566&version=latest | |
| REDIS_DSN: redis://127.0.0.1:6379 | |
| KAFKA_DSN: 127.0.0.1:9092 | |
| COMPOSER_PROCESS_TIMEOUT: 3600 | |
| steps: | |
| - name: PHP ${{ matrix.php-versions }} - ${{ matrix.stability }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: grpc, rdkafka | |
| coverage: none | |
| - name: Install OpenSSH (For Kafka) | |
| run: sudo apt-get update && sudo apt-get install -y --no-install-recommends openssh-client | |
| - uses: actions/checkout@v2 | |
| - name: Wait for Kafka to be ready | |
| run: | | |
| echo "Waiting for Kafka to start..." | |
| for i in {1..30}; do | |
| if timeout 5 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/9092' 2>/dev/null; then | |
| echo "Kafka is ready!" | |
| exit 0 | |
| fi | |
| echo "Attempt $i: Kafka not ready yet, waiting 2 seconds..." | |
| sleep 2 | |
| done | |
| echo "Kafka failed to start within 60 seconds" | |
| exit 1 | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate --strict | |
| - name: Install dependencies | |
| run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
| - name: Test PHPStan | |
| run: vendor/bin/phpstan | |
| - name: Test PHPUnit on Postgres | |
| run: vendor/bin/phpunit --no-coverage | |
| env: | |
| DATABASE_DSN: pgsql://ecotone:[email protected]:5432/ecotone?serverVersion=16 | |
| SECONDARY_DATABASE_DSN: mysql://ecotone:[email protected]:3306/ecotone?serverVersion=8.0 | |
| - name: Test Behat on Postgres | |
| run: vendor/bin/behat -vvv | |
| env: | |
| DATABASE_DSN: pgsql://ecotone:[email protected]:5432/ecotone?serverVersion=16 | |
| SECONDARY_DATABASE_DSN: mysql://ecotone:[email protected]:3306/ecotone?serverVersion=8.0 | |
| - name: Test PHPUnit on Mysql | |
| run: vendor/bin/phpunit --no-coverage | |
| env: | |
| DATABASE_DSN: mysql://ecotone:[email protected]:3306/ecotone?serverVersion=8.0 | |
| SECONDARY_DATABASE_DSN: pgsql://ecotone:[email protected]:5432/ecotone?serverVersion=16 | |
| - name: Test Behat on Mysql | |
| run: vendor/bin/behat -vvv | |
| env: | |
| DATABASE_DSN: mysql://ecotone:[email protected]:3306/ecotone?serverVersion=8.0 | |
| SECONDARY_DATABASE_DSN: pgsql://ecotone:[email protected]:5432/ecotone?serverVersion=16 |