-
Notifications
You must be signed in to change notification settings - Fork 107
137 lines (137 loc) · 4.85 KB
/
Copy pathci.yml
File metadata and controls
137 lines (137 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
with:
upcomingReleases: true
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