Skip to content

Commit c4e1323

Browse files
authored
Merge pull request #111 from ThePay/v1-to-v2
V1 to v2
2 parents fa953c2 + 034acf5 commit c4e1323

2 files changed

Lines changed: 41 additions & 150 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 40 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -6,185 +6,76 @@ on:
66
- "**"
77

88
jobs:
9-
php84:
10-
name: "php 8.4"
9+
php-tests:
10+
name: php ${{ matrix.php-version }}
1111
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']
2716

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
4317
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
4620

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:
6921
- 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
7130

7231
- name: Install dependencies
73-
run: composer update --no-interaction --with psr/http-message:^2.0
32+
run: composer install --no-interaction
7433

75-
- name: Check code style
34+
- name: Check code style (PHP 8.5)
35+
if: matrix.php-version == '8.5'
7636
run: composer cs-check
7737

7838
- name: Run static analysis
7939
run: composer stan
8040

8141
- 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
8343

8444
- name: Run tests
8545
run: composer test
8646

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
13047

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 }}
13950
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']
14956

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
17157
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
17660

17761
- 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
17970

18071
- name: Install dependencies
181-
run: composer install --no-interaction
72+
run: composer update --no-interaction --with psr/http-message:^${{ matrix.psr-http-message-version }}
18273

18374
- name: Run static analysis
18475
run: composer stan
18576

18677
- 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
18879

18980
- name: Run tests
19081
run: composer test
@@ -195,7 +86,7 @@ jobs:
19586
container: "node"
19687
steps:
19788
- name: Checkout repository
198-
uses: actions/checkout@v3
89+
uses: actions/checkout@v6
19990

20091
- name: Install dependencies
20192
run: npm install

‎tests/Mocks/TheConfig.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public function __construct()
2222
*/
2323
public function getApiUrl()
2424
{
25-
return 'http://openAPImock:1080/v1/';
25+
return 'http://localhost:1080/v1/';
2626
}
2727
}

0 commit comments

Comments
 (0)