respect-validation/.github/workflows/continuous-integration.yml
Henrique Moody 6022914cf0
Remove Yes and No rules
I created those validators to make it easy to parse parameters or
console command inputs that were answers to questions one might ask.

One of the biggest problems is that it depends on the machine's locale,
which can be a bit troublesome, rather than receiving a locale in the
constructor. That doesn’t allow for a lot of flexibility when someone
has a multi-lingual application. Additionally, these validators rely on
the regex from `nl_langinfo()`, which is very permissive, resulting in
false positives.

I have a working version of a console command that retrieves data from
the Unicode Common Locale Data Repository (CLDR) and updates a list of
`yesstr` and `nostr` strings from the main XML file of each language.
However, I came to realise that the whole thing is not worth it.

The validators Yes and No can be replaced by using rules like `Regex`
and `In`. They won’t have the ease of multilingual support, but I don’t
think those validators are used a lot. So, I decided I would just remove
them, and if users really ask for it in the next major version, I’d be
happy to revive my branch.
2026-01-10 05:47:28 +01:00

94 lines
2 KiB
YAML

name: Continuous Integration
on:
push:
paths-ignore:
- 'bin/**'
- 'docs/**'
pull_request:
paths-ignore:
- 'bin/**'
- 'docs/**'
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.5"
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Install Dependencies
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}
- name: Run Unit Tests
run: ./vendor/bin/phpunit --testsuite=unit
- name: Run Integration Tests
run: ./vendor/bin/pest --testsuite=feature --compact
code-coverage:
name: Code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
coverage: pcov
- name: Install Dependencies
run: composer install --prefer-dist ${{ matrix.composer-extra-arguments }}
- name: Generating Code Coverage Report
run: ./vendor/bin/pest --compact --coverage-clover=coverage.xml
- name: Send Code Coverage Report to Codecov.io
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
coverage: none
- name: Install dependencies
run: composer install --prefer-dist
- name: Run DocHeader
run: vendor/bin/docheader check library/ tests/
- name: Run PHP_CodeSniffer
run: vendor/bin/phpcs
- name: Run PHPStan
run: vendor/bin/phpstan analyze