Skip to content

Commit 7acbfac

Browse files
committed
feat!: drop old phpunit, automated releases
1 parent 74476dd commit 7acbfac

File tree

7 files changed

+96
-14
lines changed

7 files changed

+96
-14
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ jobs:
66
tests:
77
runs-on: ubuntu-latest
88

9-
env:
10-
COMPOSER_ROOT_VERSION: 4.99.99
11-
129
strategy:
1310
matrix:
14-
php: [8.1, 8.2, 8.3, 8.4]
11+
php: [8.2, 8.3, 8.4]
1512

1613
steps:
1714
- name: Checkout code

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Automated release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
php: [ 8.2, 8.3, 8.4 ]
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
coverage: none
23+
24+
- name: Validate composer.json and composer.lock
25+
run: composer validate
26+
27+
- name: Install dependencies
28+
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
29+
30+
- name: Execute Code Sniffer
31+
run: vendor/bin/phpcs
32+
33+
- name: Execute PHP Stan
34+
run: vendor/bin/phpstan
35+
36+
- name: Run test suite
37+
run: |
38+
php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &
39+
php -S 127.0.0.1:8010 -t tests/data/rest >/dev/null 2>&1 &
40+
php vendor/bin/codecept run
41+
42+
43+
release:
44+
name: Automated release
45+
needs:
46+
- tests
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
with:
51+
fetch-depth: 0
52+
persist-credentials: false
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
- run: >
57+
npx
58+
-p "@semantic-release/commit-analyzer"
59+
-p "@semantic-release/release-notes-generator"
60+
-p conventional-changelog-conventionalcommits
61+
-p semantic-release
62+
-- semantic-release
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
permissions:
66+
packages: write
67+
contents: write
68+
pull-requests: write

.releaserc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": ["master"],
3+
"tagFormat": "${version}",
4+
"plugins": [
5+
["@semantic-release/commit-analyzer", {
6+
"preset": "conventionalcommits",
7+
"presetConfig": {}
8+
}],
9+
"@semantic-release/github",
10+
"@semantic-release/release-notes-generator"]
11+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
],
1919
"homepage": "https://codeception.com/",
2020
"require": {
21-
"php": "^8.1",
21+
"php": "^8.2",
2222
"ext-dom": "*",
2323
"ext-json": "*",
2424
"ext-mbstring": "*",
2525
"codeception/codeception": "^5.0.8",
2626
"codeception/lib-web": "^1.0.1",
27-
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
27+
"phpunit/phpunit": "^11.5 || ^12.0",
2828
"symfony/browser-kit": "^4.4.24 || ^5.4 || ^6.0 || ^7.0",
2929
"symfony/dom-crawler": "^4.4.30 || ^5.4 || ^6.0 || ^7.0"
3030
},

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
paths:
3+
- ./src
4+
- ./tests
5+
level: 1

src/Codeception/Lib/Framework.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
*/
1212
abstract class Framework extends InnerBrowser
1313
{
14-
/**
15-
* Returns a list of recognized domain names
16-
*/
17-
protected function getInternalDomains(): array
18-
{
19-
return [];
20-
}
21-
2214
public function _beforeSuite($settings = [])
2315
{
2416
/**

src/Codeception/Lib/InnerBrowser.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ protected function clientRequest(
248248
protected function isInternalDomain(string $domain): bool
249249
{
250250
if ($this->internalDomains === null) {
251+
251252
$this->internalDomains = $this->getInternalDomains();
252253
}
253254

@@ -260,6 +261,14 @@ protected function isInternalDomain(string $domain): bool
260261
return false;
261262
}
262263

264+
/**
265+
* Returns a list of recognized domain names
266+
*/
267+
protected function getInternalDomains(): array
268+
{
269+
return [];
270+
}
271+
263272
/**
264273
* Opens a page with arbitrary request parameters.
265274
* Useful for testing multi-step forms on a specific step.

0 commit comments

Comments
 (0)