data protection #1390
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: 'PR stats' | |
| on: | |
| pull_request: | |
| # Cancel in-progress jobs when a new commit is pushed | |
| concurrency: | |
| group: benchmark-${{ github.workflow }}-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| run: | |
| name: "Benchmark" | |
| 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.3 ] | |
| stability: [prefer-stable] | |
| services: | |
| rabbitmq: | |
| image: rabbitmq:4.1.4-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 | |
| DATABASE_DSN: pgsql://ecotone:[email protected]:5432/ecotone | |
| steps: | |
| - name: PHP ${{ matrix.php-versions }} - ${{ matrix.stability }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: grpc, rdkafka | |
| coverage: none | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: main | |
| - name: Install dependencies | |
| run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
| - name: Benchmark main as baseline | |
| id: baseline | |
| continue-on-error: true | |
| run: | | |
| vendor/bin/phpbench run --retry-threshold=5 --tag=main --report=github-report --profile=opcache_enabled | |
| - uses: actions/checkout@v3 | |
| with: | |
| clean: false | |
| - name: Remove cached files but keep phpbench results | |
| run: | | |
| git clean -fxd -e .phpbench -e vendor | |
| - name: Install dependencies | |
| run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction | |
| - name: Benchmark PR | |
| shell: bash | |
| env: | |
| PHPBENCH_REF_OPTION: "${{ steps.baseline.outcome == 'success' && '--ref=main' || '' }}" | |
| run: | | |
| echo "Baseline: $PHPBENCH_REF_OPTION" | |
| vendor/bin/phpbench run --retry-threshold=5 --report=github-report --profile=opcache_enabled $PHPBENCH_REF_OPTION | bin/phpbench-to-md.sh > benchmark.md | |
| cat benchmark.md | |
| echo '## Benchmark' >> "$GITHUB_STEP_SUMMARY" | |
| cat benchmark.md >> "$GITHUB_STEP_SUMMARY" |