Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,23 @@ jobs:
with:
dependency-versions: highest

- run: composer pest:unit -- --ci --coverage-clover coverage-unit.xml
if: ${{ matrix.coverage == 'xdebug' }}

- run: composer pest:unit -- --ci
if: ${{ matrix.coverage != 'xdebug' }}

- run: composer pest:feature -- --ci
- run: composer pest:e2e -- --ci
- run: composer pest:unit -- ${COVERAGE} --ci
env:
COVERAGE: ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-unit.xml' || '' }}
- run: composer pest:feature -- ${COVERAGE} --ci
env:
COVERAGE: ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-feature.xml' || '' }}
- run: composer pest:e2e -- ${COVERAGE} --ci
env:
COVERAGE: ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-e2e.xml' || '' }}

Comment on lines +62 to 71
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shell variable expansion syntax ${COVERAGE} may not work correctly in GitHub Actions depending on the shell context. Consider using GitHub Actions expression syntax directly in the run command or ensure the shell is explicitly set to bash.

Suggested change
- run: composer pest:unit -- ${COVERAGE} --ci
env:
COVERAGE: ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-unit.xml' || '' }}
- run: composer pest:feature -- ${COVERAGE} --ci
env:
COVERAGE: ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-feature.xml' || '' }}
- run: composer pest:e2e -- ${COVERAGE} --ci
env:
COVERAGE: ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-e2e.xml' || '' }}
- run: composer pest:unit -- ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-unit.xml' || '' }} --ci
- run: composer pest:feature -- ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-feature.xml' || '' }} --ci
- run: composer pest:e2e -- ${{ matrix.coverage == 'xdebug' && '--coverage-clover coverage-e2e.xml' || '' }} --ci

Copilot uses AI. Check for mistakes.
- uses: actions/upload-artifact@v4
if: ${{ matrix.coverage == 'xdebug' }}
with:
name: coverage
path: coverage-unit.xml
path: coverage-*.xml

codecov:
needs: pest
Expand All @@ -91,3 +94,19 @@ jobs:
disable_search: true
files: coverage-unit.xml
flags: unit

- uses: codecov/codecov-action@v5
with:
use_oidc: true
fail_ci_if_error: true
disable_search: true
files: coverage-feature.xml
flags: feature

- uses: codecov/codecov-action@v5
with:
use_oidc: true
fail_ci_if_error: true
disable_search: true
files: coverage-e2e.xml
flags: e2e
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Composer template
composer.phar
composer.lock
/vendor/
/coverage.xml
# Composer
/vendor

# Pest
/coverage*.xml
126 changes: 61 additions & 65 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,65 @@
{
"name": "typisttech/wordfence-api",
"description": "Fetch WordPress vulnerability information from Wordfence vulnerability data feed.",
"license": "MIT",
"keywords": [
"security",
"wordfence",
"wordpress"
],
"authors": [
{
"name": "Typist Tech",
"email": "wordfence-api@typist.tech",
"homepage": "https://typist.tech/"
"name": "typisttech/wordfence-api",
"description": "Fetch WordPress vulnerability information from Wordfence vulnerability data feed.",
"license": "MIT",
"keywords": [
"security",
"wordfence",
"wordpress"
],
"authors": [
{
"name": "Typist Tech",
"email": "wordfence-api@typist.tech",
"homepage": "https://typist.tech/"
},
{
"name": "Tang Rufus",
"email": "tangrufus@gmail.com",
"homepage": "https://typist.tech/",
"role": "Developer"
}
],
"homepage": "https://github.com/typisttech/wordfence-api",
"support": {
"email": "wordfence-api@typist.tech",
"issues": "https://github.com/typisttech/wordfence-api/issues",
"source": "https://github.com/typisttech/wordfence-api"
},
{
"name": "Tang Rufus",
"email": "tangrufus@gmail.com",
"homepage": "https://typist.tech/",
"role": "Developer"
}
],
"homepage": "https://github.com/typisttech/wordfence-api",
"support": {
"email": "wordfence-api@typist.tech",
"issues": "https://github.com/typisttech/wordfence-api/issues",
"source": "https://github.com/typisttech/wordfence-api"
},
"require": {
"php": "^8.3",
"composer/semver": "^3.4",
"guzzlehttp/guzzle": "^7.9"
},
"require-dev": {
"mockery/mockery": "^1.6",
"pestphp/pest": "^3.5",
"roave/security-advisories": "dev-latest"
},
"autoload": {
"psr-4": {
"TypistTech\\WordfenceApi\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
"require": {
"php": "^8.3",
"composer/semver": "^3.4",
"guzzlehttp/guzzle": "^7.9"
},
"sort-packages": true
},
"scripts": {
"fixture:download": [
"curl -o ./tests/fixtures/vulnerabilities.production.json https://www.wordfence.com/api/intelligence/v2/vulnerabilities/production",
"curl -o ./tests/fixtures/vulnerabilities.scanner.json https://www.wordfence.com/api/intelligence/v2/vulnerabilities/scanner"
],
"pest:e2e": "pest -d memory_limit=512M --group=e2e",
"pest:feature": "pest -d memory_limit=640M --group=feature",
"pest:unit": "pest --group=unit",
"test": [
"@composer normalize --dry-run",
"pint --test",
"XDEBUG_MODE=off pest -d memory_limit=640M"
]
}
"require-dev": {
"mockery/mockery": "^1.6",
"pestphp/pest": "^4.1",
"roave/security-advisories": "dev-latest"
},
"autoload": {
"psr-4": {
"TypistTech\\WordfenceApi\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
},
"sort-packages": true
},
"scripts": {
"fixture:download": [
"curl -o ./tests/Fixtures/vulnerabilities.production.json https://www.wordfence.com/api/intelligence/v2/vulnerabilities/production",
"curl -o ./tests/Fixtures/vulnerabilities.scanner.json https://www.wordfence.com/api/intelligence/v2/vulnerabilities/scanner"
],
"pest": "pest -d memory_limit=512M",
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new 'pest' script duplicates the memory limit configuration that's already present in 'pest:feature'. The memory limit change from 640M to 512M should be documented or reconsidered, as this represents a ~20% reduction in available memory that could impact test execution.

Copilot uses AI. Check for mistakes.
"pest:e2e": "pest -d memory_limit=512M --group=e2e",
"pest:feature": "pest -d memory_limit=512M --group=feature",
"pest:unit": "pest --group=unit"
}
}
Loading