Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for pest-php #81

Merged
merged 15 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
44 changes: 23 additions & 21 deletions .github/workflows/github-releases-to-discord.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
on:
release:
types: [published]

jobs:
github-releases-to-discord:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Github Releases To Discord
uses: SethCohen/[email protected]
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: "2105893"
username: "Buggregator Trap release"
avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
content: "||@here||"
footer_title: "Changelog"
footer_icon_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
footer_timestamp: true
---

on: # yamllint disable-line rule:truthy
release:
types: [published]

jobs:
github-releases-to-discord:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Github Releases To Discord
uses: SethCohen/[email protected]
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: "2105893"
username: "Buggregator Trap release"
avatar_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
content: "||@here||"
footer_title: "Changelog"
footer_icon_url: "https://cdn.discordapp.com/avatars/487431320314576937/bd64361e4ba6313d561d54e78c9e7171.png"
footer_timestamp: true
112 changes: 0 additions & 112 deletions .github/workflows/run-test-suite.yml

This file was deleted.

139 changes: 130 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,136 @@
---

name: Testing
name: 🧪 Unit testing

on: # yamllint disable-line rule:truthy
- push
- pull_request
pull_request:
branches:
- master
push:
branches:
- master

jobs:
unit:
name: Unit Testing
uses: ./.github/workflows/run-test-suite.yml
with:
fail-fast: false
test-suite: Unit
code-coverage:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: code-coverage-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
php-version:
- '8.2'
dependencies:
- locked
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets, opcache, pcntl, posix
ini-values: error_reporting=E_ALL
coverage: xdebug

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: 📥 Install "${{ matrix.dependencies }}" dependencies
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 🧪 Collect code coverage with Xdebug and pestphp/pest
run: composer test:cc

- name: 📤 Upload code coverage report to Codecov
uses: codecov/[email protected]
with:
files: .build/phpunit/logs/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

testing:
timeout-minutes: 4
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: true
group: testing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}-${{ matrix.dependencies }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
php-version:
- '8.1'
- '8.2'
- '8.3'
dependencies:
- lowest
- locked
- highest
steps:
- name: 📦 Check out the codebase
uses: actions/[email protected]

- name: 🛠️ Setup PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}
extensions: none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, sockets, opcache, pcntl, posix
ini-values: error_reporting=E_ALL
coverage: xdebug

- name: 🛠️ Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 🔍 Get composer cache directory
uses: wayofdev/gh-actions/actions/composer/[email protected]

- name: ♻️ Restore cached dependencies installed with composer
uses: actions/[email protected]
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: ⚙️ Remove platform configuration with composer
if: matrix.dependencies != 'locked'
run: composer config platform.php --ansi --unset

- name: 📥 Install "${{ matrix.dependencies }}" dependencies
uses: wayofdev/gh-actions/actions/composer/[email protected]
with:
dependencies: ${{ matrix.dependencies }}

- name: 🧪 Run unit tests using pestphp/pest
run: composer test

- name: 🧪 Run "leak test" using phpunit/phpunit
run: composer test:leak
8 changes: 4 additions & 4 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

Copyright (c) 2023, Buggregator.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Buggregator nor the names of its
* Neither the name of Buggregator nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ test-cc: ## Run project php-unit and pest tests in coverage mode and build repor
$(APP_COMPOSER) test:cc
.PHONY: test-cc

test-leak: ## Run project php-unit tests in memory leak detection mode
$(APP_COMPOSER) test:leak
.PHONY: test-leak

#
# Release
# ------------------------------------------------------------------------------------
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ vendor/bin/trap -p1025 -p9912 -p9913 -p8000 --ui=8080
```

Environment variables can also be used to set endpoints:

- `TRAP_TCP_PORTS` - for TCP traffic: `9912,9913,1025,8000`
- `TRAP_TCP_HOST` - for the TCP host (default: `127.0.0.1`)
- `TRAP_UI_PORT` - for the web interface: `8080`


### Choosing Your Senders

Buggregator Trap provides a variety of "senders" that dictate where the dumps will be sent. Currently, the available
Expand All @@ -181,7 +181,6 @@ For instance, to simultaneously use the console, file, and server senders, you w
vendor/bin/trap -s console -s file -s server
```


## Contributing

We believe in the power of community-driven development. Here's how you can contribute:
Expand All @@ -192,22 +191,18 @@ We believe in the power of community-driven development. Here's how you can cont
issues labeled "help wanted" [here](https://github.com/buggregator/trap/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
- **Documentation:** Help us improve our [guides and tutorials](https://github.com/buggregator/docs/tree/master/docs) for a smoother user experience.
- **Community Support:** Join our [Discord](https://discord.gg/qF3HpXhMEP) and help others get the most out of Buggregator.
- **Spread the Word:** Share your experience with Buggregator on social media and encourage others to contribute.
- **Spread the Word:** Share your experience with Buggregator on social media and encourage others to contribute.
- **Donate:** Support our work by becoming a patron or making a one-time donation
[![roxblnfk](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Droxblnfk%26type%3Dpatrons&label=roxblnfk&style=flat-square)](https://patreon.com/roxblnfk)
[![butschster](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dbutschster%26type%3Dpatrons&label=butschster&style=flat-square)](https://patreon.com/butschster)

**Remember, every great developer was once a beginner. Contributing to open source projects is a step in your journey to
becoming a better developer. So, don't hesitate to jump in and start contributing!**


## License

Buggregator Trap is open-sourced software licensed under the BSD-3 license.




<!--

Quality badges:
Expand Down
Loading