diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f19b0fe..99a08b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,17 +1,15 @@ name: CI -on: [push, pull_request] +on: + pull_request: jobs: tests: runs-on: ubuntu-latest - env: - COMPOSER_ROOT_VERSION: 4.99.99 - strategy: matrix: - php: [8.1, 8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4] steps: - name: Checkout code @@ -21,6 +19,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} + tools: phpstan - name: Validate composer.json and composer.lock run: composer validate @@ -30,3 +29,6 @@ jobs: - name: Run test suite run: php vendor/bin/codecept run + + - name: Execute PHPStan + run: phpstan diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9c2fed2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Automated release +on: + push: + branches: + - master +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + matrix: + php: [8.2, 8.3, 8.4] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: phpstan + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction --no-suggest + + + - name: Run test suite + run: php vendor/bin/codecept run + + - name: Execute PHPStan + run: phpstan + release: + name: Automated release + needs: + - tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: > + npx + -p "@semantic-release/commit-analyzer" + -p "@semantic-release/release-notes-generator" + -p conventional-changelog-conventionalcommits + -p semantic-release + -- semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +permissions: + packages: write + contents: write + pull-requests: write \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..8492546 --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,11 @@ +{ + "branches": ["master"], + "tagFormat": "${version}", + "plugins": [ + ["@semantic-release/commit-analyzer", { + "preset": "conventionalcommits", + "presetConfig": {} + }], + "@semantic-release/github", + "@semantic-release/release-notes-generator"] +} \ No newline at end of file diff --git a/composer.json b/composer.json index b4955aa..82ad1ad 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,13 @@ ], "homepage": "https://codeception.com/", "require": { - "php": "^8.1", + "php": "^8.2", "ext-dom": "*", "ext-json": "*", "ext-mbstring": "*", "codeception/codeception": "^5.0.8", "codeception/lib-web": "^1.0.1", - "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", + "phpunit/phpunit": "^11.5 || ^12.0", "symfony/browser-kit": "^4.4.24 || ^5.4 || ^6.0 || ^7.0", "symfony/dom-crawler": "^4.4.30 || ^5.4 || ^6.0 || ^7.0" }, diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..f1f9077 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + paths: + - ./src + - ./tests + level: 1 \ No newline at end of file diff --git a/src/Codeception/Lib/Framework.php b/src/Codeception/Lib/Framework.php index 9fcee63..60dc76e 100644 --- a/src/Codeception/Lib/Framework.php +++ b/src/Codeception/Lib/Framework.php @@ -11,14 +11,6 @@ */ abstract class Framework extends InnerBrowser { - /** - * Returns a list of recognized domain names - */ - protected function getInternalDomains(): array - { - return []; - } - public function _beforeSuite($settings = []) { /** diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php index 20cd4f9..09a6946 100644 --- a/src/Codeception/Lib/InnerBrowser.php +++ b/src/Codeception/Lib/InnerBrowser.php @@ -248,6 +248,7 @@ protected function clientRequest( protected function isInternalDomain(string $domain): bool { if ($this->internalDomains === null) { + $this->internalDomains = $this->getInternalDomains(); } @@ -260,6 +261,14 @@ protected function isInternalDomain(string $domain): bool return false; } + /** + * Returns a list of recognized domain names + */ + protected function getInternalDomains(): array + { + return []; + } + /** * Opens a page with arbitrary request parameters. * Useful for testing multi-step forms on a specific step.