[0.6.x] Make it abundantly clear Bunny must run in a fiber #394
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
- 0.6.x | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
supported-versions-matrix: | |
name: Supported Versions Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
extensions: ${{ steps.supported-versions-matrix.outputs.extensions }} | |
highest: ${{ steps.supported-versions-matrix.outputs.highest }} | |
lowest: ${{ steps.supported-versions-matrix.outputs.lowest }} | |
version: ${{ steps.supported-versions-matrix.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: supported-versions-matrix | |
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 | |
static-anylsis: | |
name: "Run static analysis on PHP ${{ matrix.php }}" | |
runs-on: ubuntu-latest | |
needs: | |
- supported-versions-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ${{ fromJson(format('["{0}","{1}"]"', needs.supported-versions-matrix.outputs.lowest, needs.supported-versions-matrix.outputs.highest)) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ join(fromJson(needs.supported-versions-matrix.outputs.extensions), ',') }} | |
tools: composer | |
- name: Install Dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Run PHPCS | |
run: ./vendor/bin/phpcs | |
- name: Run PHPStan | |
run: ./vendor/bin/phpstan analyze | |
test: | |
name: "Run Tests on PHP ${{ matrix.php }} against RabbitMQ ${{ matrix.rabbitmq }} (Composer: ${{ matrix.composer }}; TLS: ${{ matrix.ssl_test }})" | |
runs-on: ubuntu-latest | |
needs: | |
- supported-versions-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} | |
composer: [lowest, locked, highest] | |
rabbitmq: ["3", "3.8", "3.9", "4", "4.1"] | |
ssl_test: ["no", "yes", "client"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: ${{ join(fromJson(needs.supported-versions-matrix.outputs.extensions), ',') }} | |
tools: composer | |
- name: Install Dependencies | |
uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: ${{ matrix.composer }} | |
- name: RabbitMQ TLS Certificates | |
if: matrix.ssl_test != 'no' | |
run: | | |
cd test/tls | |
make all | |
ls -lasth | |
sudo chown 999:999 ./{ca.pem,server.pem,server.key} | |
ls -lasth | |
- name: Start RabbitMQ | |
if: matrix.ssl_test == 'no' | |
uses: namoshek/rabbitmq-github-action@v1 | |
with: | |
version: '${{ matrix.rabbitmq }}-management' | |
ports: '5672:5672 15672:15672' | |
container-name: 'rabbitmq' | |
- name: Start RabbitMQ | |
if: matrix.ssl_test == 'yes' | |
uses: namoshek/rabbitmq-github-action@v1 | |
with: | |
version: '${{ matrix.rabbitmq }}-management' | |
ports: '5673:5673 5672:5672 15672:15672' | |
container-name: 'rabbitmq' | |
certificates: ${{ github.workspace }}/test/tls | |
config: ${{ github.workspace }}/test/tls/rabbitmq.tls.verify_none.conf | |
- name: Start RabbitMQ | |
if: matrix.ssl_test == 'client' | |
uses: namoshek/rabbitmq-github-action@v1 | |
with: | |
version: '${{ matrix.rabbitmq }}-management' | |
ports: '5673:5673 5672:5672 15672:15672' | |
container-name: 'rabbitmq' | |
certificates: ${{ github.workspace }}/test/tls | |
config: ${{ github.workspace }}/test/tls/rabbitmq.tls.verify_peer.conf | |
- uses: ifaxity/wait-on-action@v1 | |
with: | |
resource: http://localhost:15672/ | |
timeout: 13000 | |
interval: 100 | |
- name: Run UnitTests | |
if: matrix.ssl_test == 'no' | |
run: ./vendor/bin/phpunit | |
env: | |
SSL_TEST: "no" | |
TEST_RABBITMQ_CONNECTION_URI: "amqp://guest:guest@localhost:5672/" | |
- name: Run UnitTests | |
if: matrix.ssl_test == 'yes' | |
run: ./vendor/bin/phpunit | |
env: | |
SSL_TEST: "yes" | |
SSL_CA: "tls/ca.pem" | |
SSL_PEER_NAME: "server.rmq" | |
TEST_RABBITMQ_CONNECTION_URI: "amqp://guest:guest@localhost:5672/" | |
- name: Run UnitTests | |
if: matrix.ssl_test == 'client' | |
run: ./vendor/bin/phpunit | |
env: | |
SSL_TEST: "client" | |
SSL_CA: "tls/ca.pem" | |
SSL_PEER_NAME: "server.rmq" | |
SSL_CLIENT_CERT: "tls/client.pem" | |
SSL_CLIENT_KEY: "tls/client.key" | |
TEST_RABBITMQ_CONNECTION_URI: "amqp://guest:guest@localhost:5672/" | |
- name: Docker Logs | |
if: ${{ failure() }} | |
run: docker logs rabbitmq |