---
services:
  format:
    platform: linux/amd64
    build:
      context: .
      dockerfile: Dockerfile.php82
      secrets:
        - github_auth
    volumes:
      - .:/var/app
    command: composer format

  unit-lint-php82:
    platform: linux/amd64
    build:
      context: .
      dockerfile: Dockerfile.php82
      secrets:
        - github_auth
    volumes:
      - ./build:/var/app/build
    environment:
      ENVIRONMENT: test
      PHP_BUILD_TARGET: php82
      SPLITIO_API_KEY: test-key
      SPLITIO_REDIS_HOST: localhost
      SPLITIO_REDIS_PORT: 6379
    command: composer lint-and-test

  unit-lint-php84:
    platform: linux/amd64
    build:
      context: .
      dockerfile: Dockerfile.php84
      secrets:
        - github_auth
    volumes:
      - ./build:/var/app/build
    environment:
      ENVIRONMENT: test
      PHP_BUILD_TARGET: php84
      SPLITIO_API_KEY: test-key
      SPLITIO_REDIS_HOST: localhost
      SPLITIO_REDIS_PORT: 6379
    command: composer lint-and-test

secrets:
  github_auth:
    environment: GITHUB_AUTH
