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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
max_line_length = 120
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2

[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
31 changes: 20 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
/tests export-ignore
/vendor export-ignore
* text=auto eol=lf

/LICENSE export-ignore
/Makefile export-ignore
/README.md export-ignore
/phpunit.xml export-ignore
/phpstan.neon.dist export-ignore
/infection.json.dist export-ignore
*.php text diff=php

# Keep Claude tooling scripts out of GitHub's language statistics
/.claude export-ignore

/.github export-ignore
/.gitignore export-ignore
/.gitattributes export-ignore
# Dev-only, excluded from the Packagist tarball
/.github export-ignore
/docs export-ignore
/tests export-ignore
/UPGRADE.md export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpcs.xml export-ignore
/phpunit.xml export-ignore
/phpstan.neon.dist export-ignore
/infection.json.dist export-ignore
/Makefile export-ignore
/reports export-ignore
/.phpunit.cache export-ignore
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Report a bug to help improve the library
labels: bug
---

## Description

A clear and concise description of the bug.

## Steps to reproduce

1.
2.
3.

## Expected behavior

What should happen.

## Actual behavior

What actually happens.

## Environment

- PHP version:
- Library version:
- OS:
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest a feature for the library
labels: enhancement
---

## Problem

What problem does this feature solve?

## Proposed solution

How should the feature work?

## Alternatives considered

Other approaches considered.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
> Please follow the [contributing guidelines](https://github.com/tiny-blocks/tiny-blocks/blob/main/CONTRIBUTING.md).

## Summary

What this pull request does.

## Related issue

Closes #...

## Checklist

- [ ] Tests added or updated.
- [ ] Documentation updated when applicable.
- [ ] `make review` passes.
- [ ] `make tests` passes.
17 changes: 12 additions & 5 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ on:
types:
- opened

concurrency:
group: auto-assign-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true

permissions:
issues: write
pull-requests: write

jobs:
run:
auto-assign:
name: Auto assign
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
timeout-minutes: 5
steps:
- name: Assign issues and pull requests
uses: gustavofreze/auto-assign@2.1.0
Expand All @@ -22,4 +29,4 @@ jobs:
github_token: '${{ secrets.GITHUB_TOKEN }}'
allow_self_assign: 'true'
allow_no_assignees: 'true'
assignment_options: 'ISSUE,PULL_REQUEST'
assignment_options: 'ISSUE,PULL_REQUEST'
66 changes: 33 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,47 @@ name: CI
on:
pull_request:

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

permissions:
contents: read

env:
PHP_VERSION: '8.5'

jobs:
resolve-tooling-image:
name: Resolve tooling image
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
php-image: ${{ steps.config.outputs.php-image }}
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Resolve tooling image from the Makefile
id: config
run: echo "php-image=$(make show-image)" >> "$GITHUB_OUTPUT"

build:
name: Build
needs: resolve-tooling-image
runs-on: ubuntu-latest

timeout-minutes: 15
env:
image: ${{ needs.resolve-tooling-image.outputs.php-image }}
workspace: /var/www/html
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: bcmath
tools: composer:2

- name: Validate composer.json
run: composer validate --no-interaction
run: docker run --rm -v "${PWD}":${{ env.workspace }} ${{ env.image }} composer validate --no-interaction

- name: Install dependencies
run: composer install --no-progress --optimize-autoloader --prefer-dist --no-interaction
run: >
docker run --rm -v "${PWD}":${{ env.workspace }} ${{ env.image }}
composer install --no-progress --optimize-autoloader --prefer-dist --no-interaction

- name: Upload vendor and composer.lock as artifact
uses: actions/upload-artifact@v7
Expand All @@ -41,50 +55,36 @@ jobs:

auto-review:
name: Auto review
needs: [resolve-tooling-image, build]
runs-on: ubuntu-latest
needs: build

timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: bcmath
tools: composer:2

- name: Download vendor artifact from build
uses: actions/download-artifact@v8
with:
name: vendor-artifact
path: .

- name: Run review
run: composer review
run: make review

tests:
name: Tests
needs: [resolve-tooling-image, auto-review]
runs-on: ubuntu-latest
needs: auto-review

timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: bcmath
tools: composer:2

- name: Download vendor artifact from build
uses: actions/download-artifact@v8
with:
name: vendor-artifact
path: .

- name: Run tests
run: composer tests
run: make tests tests-without-bcmath
35 changes: 0 additions & 35 deletions .github/workflows/codeql.yml

This file was deleted.

33 changes: 28 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
.idea
# PHP dependencies
/vendor/
composer.lock

vendor
report
.phpunit.*
# Local config overrides (committed baselines are the .dist files)
/phpstan.neon
/infection.json

*.lock
# Tooling cache
.phpunit.cache/
.phpunit.result.cache
__pycache__/
*.pyc

# Coverage and reports
build/
reports/
coverage/
infection.log

# Editors and agents
.idea/
.cursor/
.vscode/
/.claude/settings.local.json

# OS
Thumbs.db
.DS_Store
Desktop.ini
Loading