|
6 | 6 | - "**" |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - php84: |
10 | | - name: "php 8.4" |
| 9 | + php-tests: |
| 10 | + name: php ${{ matrix.php-version }} |
11 | 11 | runs-on: ubuntu-latest |
12 | | - container: "nofutur3/php-tests:8.4" |
13 | | - services: |
14 | | - openAPImock: |
15 | | - image: mockserver/mockserver |
16 | | - ports: |
17 | | - - 1080:1080 |
18 | | - steps: |
19 | | - - name: Checkout repository |
20 | | - uses: actions/checkout@v4 |
21 | | - |
22 | | - - name: Install dependencies |
23 | | - run: composer install |
24 | | - |
25 | | - - name: Run static analysis |
26 | | - run: composer stan |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + php-version: ['7.4', '8.0', '8.1', '8.3', '8.4', '8.5'] |
27 | 16 |
|
28 | | - - name: Create mock server from our production OpenAPI |
29 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
30 | | - |
31 | | - - name: Run tests |
32 | | - run: composer test |
33 | | - |
34 | | - php83: |
35 | | - name: "php 8.3" |
36 | | - runs-on: ubuntu-latest |
37 | | - container: "nofutur3/php-tests:8.3" |
38 | | - services: |
39 | | - openAPImock: |
40 | | - image: mockserver/mockserver |
41 | | - ports: |
42 | | - - 1080:1080 |
43 | 17 | steps: |
44 | | - - name: Checkout repository |
45 | | - uses: actions/checkout@v4 |
| 18 | + - name: Start mock server |
| 19 | + run: docker run -d -p 1080:1080 mockserver/mockserver |
46 | 20 |
|
47 | | - - name: Install dependencies |
48 | | - run: composer install |
49 | | - |
50 | | - - name: Run static analysis |
51 | | - run: composer stan |
52 | | - |
53 | | - - name: Create mock server from our production OpenAPI |
54 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
55 | | - |
56 | | - - name: Run tests |
57 | | - run: composer test |
58 | | - |
59 | | - php82: |
60 | | - name: "php 8.2 psr/http-message 2.0" |
61 | | - runs-on: ubuntu-latest |
62 | | - container: "nofutur3/php-tests:8.2" |
63 | | - services: |
64 | | - openAPImock: |
65 | | - image: mockserver/mockserver |
66 | | - ports: |
67 | | - - 1080:1080 |
68 | | - steps: |
69 | 21 | - name: Checkout repository |
70 | | - uses: actions/checkout@v3 |
| 22 | + uses: actions/checkout@v6 |
| 23 | + |
| 24 | + - name: Setup PHP |
| 25 | + uses: shivammathur/setup-php@v2 |
| 26 | + with: |
| 27 | + php-version: ${{ matrix.php-version }} |
| 28 | + coverage: none |
| 29 | + extensions: mbstring, intl, curl |
71 | 30 |
|
72 | 31 | - name: Install dependencies |
73 | | - run: composer update --no-interaction --with psr/http-message:^2.0 |
| 32 | + run: composer install --no-interaction |
74 | 33 |
|
75 | | - - name: Check code style |
| 34 | + - name: Check code style (PHP 8.5) |
| 35 | + if: matrix.php-version == '8.5' |
76 | 36 | run: composer cs-check |
77 | 37 |
|
78 | 38 | - name: Run static analysis |
79 | 39 | run: composer stan |
80 | 40 |
|
81 | 41 | - name: Create mock server from our production OpenAPI |
82 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
| 42 | + run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://localhost:1080/mockserver/openapi |
83 | 43 |
|
84 | 44 | - name: Run tests |
85 | 45 | run: composer test |
86 | 46 |
|
87 | | - php82psrmessage10: |
88 | | - name: "php 8.2 psr/http-message 1.0" |
89 | | - runs-on: ubuntu-latest |
90 | | - container: "nofutur3/php-tests:8.2" |
91 | | - services: |
92 | | - openAPImock: |
93 | | - image: mockserver/mockserver |
94 | | - ports: |
95 | | - - 1080:1080 |
96 | | - steps: |
97 | | - - name: Checkout repository |
98 | | - uses: actions/checkout@v3 |
99 | | - |
100 | | - - name: Install dependencies |
101 | | - run: composer update --no-interaction --with psr/http-message:^1.0 |
102 | | - |
103 | | - - name: Run static analysis |
104 | | - run: composer stan |
105 | | - |
106 | | - - name: Create mock server from our production OpenAPI |
107 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
108 | | - |
109 | | - - name: Run tests |
110 | | - run: composer test |
111 | | - |
112 | | - php81: |
113 | | - name: "php 8.1" |
114 | | - runs-on: ubuntu-latest |
115 | | - container: "nofutur3/php-tests:8.1" |
116 | | - services: |
117 | | - openAPImock: |
118 | | - image: mockserver/mockserver |
119 | | - ports: |
120 | | - - 1080:1080 |
121 | | - steps: |
122 | | - - name: Checkout repository |
123 | | - uses: actions/checkout@v3 |
124 | | - |
125 | | - - name: Install dependencies |
126 | | - run: composer install --no-interaction |
127 | | - |
128 | | - - name: Run static analysis |
129 | | - run: composer stan |
130 | 47 |
|
131 | | - - name: Create mock server from our production OpenAPI |
132 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
133 | | - |
134 | | - - name: Run tests |
135 | | - run: composer test |
136 | | - |
137 | | - php80: |
138 | | - name: "php 8.0" |
| 48 | + php-with-psr-tests: |
| 49 | + name: php ${{ matrix.php-version }} psr/http-message ${{ matrix.psr-http-message-version }} |
139 | 50 | runs-on: ubuntu-latest |
140 | | - container: "nofutur3/php-tests:8.0" |
141 | | - services: |
142 | | - openAPImock: |
143 | | - image: mockserver/mockserver |
144 | | - ports: |
145 | | - - 1080:1080 |
146 | | - steps: |
147 | | - - name: Checkout repository |
148 | | - uses: actions/checkout@v3 |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + php-version: ['8.2'] |
| 55 | + psr-http-message-version: ['1.0', '2.0'] |
149 | 56 |
|
150 | | - - name: Install dependencies |
151 | | - run: composer install --no-interaction |
152 | | - |
153 | | - - name: Run static analysis |
154 | | - run: composer stan |
155 | | - |
156 | | - - name: Create mock server from our production OpenAPI |
157 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
158 | | - |
159 | | - - name: Run tests |
160 | | - run: composer test |
161 | | - |
162 | | - php74: |
163 | | - name: "php 7.4" |
164 | | - runs-on: ubuntu-latest |
165 | | - container: "nofutur3/php-tests:7.4" |
166 | | - services: |
167 | | - openAPImock: |
168 | | - image: mockserver/mockserver |
169 | | - ports: |
170 | | - - 1080:1080 |
171 | 57 | steps: |
172 | | - # Deprecation example for future support removal. |
173 | | - # |
174 | | - #- name: Deprecation check (2023-01-01T00:00:00+01:00) |
175 | | - # run: if [ "$(date +%s)" -gt "1672527600" ]; then echo "This PHP version support ended"; exit1; else echo "Deprecation OK"; fi |
| 58 | + - name: Start mock server |
| 59 | + run: docker run -d -p 1080:1080 mockserver/mockserver |
176 | 60 |
|
177 | 61 | - name: Checkout repository |
178 | | - uses: actions/checkout@v3 |
| 62 | + uses: actions/checkout@v6 |
| 63 | + |
| 64 | + - name: Setup PHP |
| 65 | + uses: shivammathur/setup-php@v2 |
| 66 | + with: |
| 67 | + php-version: ${{ matrix.php-version }} |
| 68 | + coverage: none |
| 69 | + extensions: mbstring, intl, curl |
179 | 70 |
|
180 | 71 | - name: Install dependencies |
181 | | - run: composer install --no-interaction |
| 72 | + run: composer update --no-interaction --with psr/http-message:^${{ matrix.psr-http-message-version }} |
182 | 73 |
|
183 | 74 | - name: Run static analysis |
184 | 75 | run: composer stan |
185 | 76 |
|
186 | 77 | - name: Create mock server from our production OpenAPI |
187 | | - run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://openAPImock:1080/mockserver/openapi |
| 78 | + run: curl -X PUT -d "{\"specUrlOrPayload\":\"https://gate.thepay.cz/openapi.yaml\"}" http://localhost:1080/mockserver/openapi |
188 | 79 |
|
189 | 80 | - name: Run tests |
190 | 81 | run: composer test |
|
195 | 86 | container: "node" |
196 | 87 | steps: |
197 | 88 | - name: Checkout repository |
198 | | - uses: actions/checkout@v3 |
| 89 | + uses: actions/checkout@v6 |
199 | 90 |
|
200 | 91 | - name: Install dependencies |
201 | 92 | run: npm install |
|
0 commit comments