Skip to content

Bump phpstan/phpdoc-parser from 1.25.0 to 1.30.0 #783

Bump phpstan/phpdoc-parser from 1.25.0 to 1.30.0

Bump phpstan/phpdoc-parser from 1.25.0 to 1.30.0 #783

Workflow file for this run

name: Test
on:
push:
pull_request:
types: [ opened, synchronize, reopened ]
env:
TEST_TIMEOUT: 120
CFLAGS: -g -O0 -fstack-protector-strong -Wall -Werror -D_GNU_SOURCE
MAKEFLAGS: -j4 PHP_EXECUTABLE=./infra/tools/pamqp-php-cli-deterministic
jobs:
prep:
name: Prepare
continue-on-error: true
runs-on: ubuntu-22.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
php_versions: ${{ steps.matrix.outputs.php_versions }}
librabbitmq_versions: ${{ steps.matrix.outputs.librabbitmq_versions }}
memory_build_matrix: ${{ steps.matrix.outputs.memory_build_matrix }}
steps:
- id: skip_check
name: Prevent duplicate builds
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
skip_after_successful_duplicate: 'true'
cancel_others: 'true'
concurrent_skipping: 'same_content_newer'
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Prepare matrix
id: matrix
run: |
infra/tools/pamqp-matrix >> "$GITHUB_OUTPUT"
checkstyle:
name: Check C formatting
runs-on: ubuntu-22.04
needs: prep
if: needs.prep.outputs.should_skip != 'true'
steps:
- name: Install clang-format
uses: myci-actions/add-deb-repo@11
with:
repo: 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main'
repo-name: llvm
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
install: clang-format-17
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Check style
run: ./infra/tools/pamqp-format-check
stubs:
name: Check stubs php-${{ matrix.php-version }}
runs-on: ubuntu-22.04
needs: prep
if: needs.prep.outputs.should_skip != 'true'
strategy:
fail-fast: false
matrix:
php-version: ${{ fromJson(needs.prep.outputs.php_versions) }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Install packages
uses: awalsh128/cache-apt-pkgs-action@v1.4.1
with:
packages: cmake
- name: Setup PHP
uses: shivammathur/setup-php@2.29.0
with:
php-version: ${{ matrix.php-version }}
extensions: json
coverage: none
env:
debug: true
- name: Check stubs
run: ./infra/tools/pamqp-stubs-lint
- name: Build librabbitmq
run: ./infra/tools/pamqp-install-librabbitmq master
- name: Build PHP extension
run: phpize && ./configure && make
- name: Validate stubs
run: ./infra/tools/pamqp-stubs-validate
- name: Check stub coding style
run: ./infra/tools/pamqp-stubs-format-check
- name: Validate argument parsing
run: ./infra/tools/pamqp-php-cli-deterministic -d extension=modules/amqp.so ./infra/tools/pamqp-arguments-validate
test:
name: ${{ matrix.test-php-args == '-m' && 'Memtest' || 'Test' }} php-${{ matrix.php-version }}${{ matrix.php-thread-safe && '-ts' || '-nts' }} librabbitmq-${{ matrix.librabbitmq-version }} ${{ matrix.compiler }}
# librabbitmq < 0.11 needs older OpenSSL version which comes with Ubuntu 20.04
runs-on: ${{ (matrix.librabbitmq-version == '0.10.0' || matrix.librabbitmq-version == '0.9.0' || matrix.librabbitmq-version == '0.8.0') && 'ubuntu-20.04' || 'ubuntu-22.04' }}
needs: prep
if: needs.prep.outputs.should_skip != 'true'
env:
CC: ${{ matrix.compiler }}
TEST_PHP_ARGS: -j4 ${{ matrix.test-php-args }}
PHP_AMQP_HOST: localhost
PHP_AMQP_SSL_HOST: rabbitmq.example.org
VALGRIND_OPTS: '--suppressions=infra/tools/valgrind-suppressions'
strategy:
fail-fast: false
matrix:
php-version: ${{ fromJson(needs.prep.outputs.php_versions) }}
php-thread-safe: [ true, false ]
librabbitmq-version: ${{ fromJson(needs.prep.outputs.librabbitmq_versions) }}
compiler: [gcc, clang]
include: ${{ fromJson(needs.prep.outputs.memory_build_matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Configure hostnames
run: sudo echo "127.0.0.1 ${{ env.PHP_AMQP_SSL_HOST }}" | sudo tee -a /etc/hosts
- name: Generate test certificates
run: docker compose up ca
- name: Start RabbitMQ
run: docker compose up -d rabbitmq
- name: Install packages
uses: awalsh128/cache-apt-pkgs-action@v1.4.1
with:
packages: cmake valgrind libc6-dbg gcc clang
version: ${{ (matrix.librabbitmq-version == '0.10.0' || matrix.librabbitmq-version == '0.9.0' || matrix.librabbitmq-version == '0.8.0') && 'ubuntu-20.04' || 'ubuntu-22.04' }}
- name: Setup PHP
uses: shivammathur/setup-php@2.29.0
with:
php-version: ${{ matrix.php-version }}
coverage: none
extensions: simplexml
env:
phpts: ${{ matrix.php-thread-safe && 'ts' || 'nts' }}
debug: true
- name: Build librabbitmq
run: ./infra/tools/pamqp-install-librabbitmq ${{ matrix.librabbitmq-version }}
- name: Print librabbitmq version
run: pkg-config librabbitmq --debug
- name: Build PHP extension
run: phpize && ./configure && make
- name: Run minimal test suite
run: make test | tee result-minimal.txt
env:
# Reset defaults to a) only run local tests, b) don’t run memory checks as the full test suite run will do so
TEST_PHP_ARGS: '-j4 -q'
PHP_AMQP_HOST: ''
PHP_AMQP_SSL_HOST: ''
- name: Test full test suite
run: make test | tee result-full.txt
- name: Benchmark PHP extension
run: ./infra/tools/pamqp-php-cli-deterministic -d extension=modules/amqp.so benchmark.php
- name: Dump report
run: ./infra/tools/pamqp-test-report