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
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
* text=auto eol=lf

/.github export-ignore
/art export-ignore
/tests export-ignore
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
/phpstan.neon export-ignore
/rector.php export-ignore
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/SECURITY.md export-ignore
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: JonPurvis
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**Why**

<!-- What problem does this solve, or what does it add? -->

**What**

<!-- Summary of the change. -->

**Checklist**

- [ ] `composer test` passes locally (Pint, Rector, PHPStan, type coverage, Pest)
- [ ] Coding style: `composer lint`
- [ ] Commits are meaningful and follow SemVer-friendly changes
58 changes: 58 additions & 0 deletions .github/workflows/formats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Formats

on:
push:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest

name: Formats P8.5 - ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6

- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: 8.5
extensions: dom, mbstring, zip, pcntl
coverage: pcov

- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-php-8.5-os-ubuntu-latest-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-php-8.5-os-ubuntu-latest-composer-

- name: Install Composer dependencies
run: composer update --prefer-stable --no-interaction --prefer-dist

- name: Coding Style Checks
run: composer test:lint

- name: Type Checks
run: composer test:types

- name: Type Coverage Checks
run: composer test:type-coverage

- name: Refactor Checks
run: composer test:refactor
68 changes: 40 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,60 @@ on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.4, 8.5]
stability: [prefer-stable]

name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
os: [ubuntu-latest]
php: ['8.3', '8.4', '8.5']
dependency-version: [prefer-stable]
include:
- os: windows-latest
php: '8.5'
dependency-version: prefer-stable
- os: ubuntu-latest
php: '8.3'
dependency-version: prefer-lowest

name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
# actions/checkout@v6.1.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1

- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6

- name: Setup PHP
# shivammathur/setup-php@2.37.2
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
# pcntl is Unix-only (used by php-fuzzer timeouts); omit on Windows.
# Do not use `&& '' || …` — empty string is falsy and still selects pcntl.
extensions: ${{ matrix.os == 'windows-latest' && 'dom, curl, libxml, mbstring, zip, fileinfo' || 'dom, curl, libxml, mbstring, zip, fileinfo, pcntl' }}
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
extensions: ${{ matrix.os == 'windows-latest' && 'dom, mbstring, zip' || 'dom, mbstring, zip, pcntl' }}
coverage: pcov

- name: Install dependencies
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Execute tests
run: vendor/bin/pest
- name: Cache dependencies
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-

- name: Run Pint
run: vendor/bin/pint --test --dirty
- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist

- name: Run Analysis
run: vendor/bin/phpstan analyse
- name: Unit Tests
run: composer test:unit
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Adds first version
59 changes: 52 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,62 @@
# Contributing
# CONTRIBUTING

Thank you for considering contributing to `jonpurvis/fuzz`.
Contributions are welcome, and are accepted via pull requests.
Please review these guidelines before submitting any pull requests.

## Process

1. Fork the project
1. Create a new branch
1. Code, test, commit and push
1. Open a pull request detailing your changes. Make sure to follow the [template](.github/PULL_REQUEST_TEMPLATE.md)

## Guidelines

- PHP 8.3+, Pest 4 or 5.
- Keep the fuzzer worker isolated from the Pest parent process.
- Please ensure the coding style running `composer lint`.
- Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
- You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
- Please remember that we follow [SemVer](http://semver.org/).

## Setup

Clone your fork, then install the dev dependencies:

```bash
composer install
```

## Lint

Lint your code:

```bash
composer lint
```

## Tests

Run all tests:

```bash
composer test
```

## Guidelines
Check types:

```bash
composer test:types
```

Type coverage:

- PHP 8.4+, Pest 5
- Keep the fuzzer worker isolated from the Pest parent process
- Prefer small, focused pull requests
- Run `composer test` before opening a PR (Pint, PHPStan, Pest)
```bash
composer test:type-coverage
```

Unit tests:

```bash
composer test:unit
```
Loading
Loading