mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-31 07:01:54 +00:00
Merge pull request #338 from euantorano/feature/github-actions
Fixed #337 - add GitHub Actions workflow to run tests
This commit is contained in:
commit
0282ca420b
73
.github/workflows/test.yml
vendored
Normal file
73
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
name: Run Tests
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: ['ubuntu-latest']
|
||||||
|
php-versions:
|
||||||
|
- '5.4'
|
||||||
|
- '5.5'
|
||||||
|
- '5.6'
|
||||||
|
- '7.0'
|
||||||
|
- '7.1'
|
||||||
|
- '7.2'
|
||||||
|
- '7.3'
|
||||||
|
- '7.4'
|
||||||
|
# - '8.0'
|
||||||
|
# - '8.1'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
- name: Cache composer packages
|
||||||
|
id: composer-cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: vendor
|
||||||
|
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-php-${{ matrix.php-versions }}-
|
||||||
|
- name: Validate composer configuration
|
||||||
|
run: |
|
||||||
|
composer validate
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
composer run-script test
|
||||||
|
|
||||||
|
# test-hhvm:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# - name: Setup HHVM
|
||||||
|
# uses: azjezz/setup-hhvm@v1
|
||||||
|
# with:
|
||||||
|
# version: latest
|
||||||
|
# debug: false
|
||||||
|
# - name: Cache composer packages
|
||||||
|
# id: composer-cache
|
||||||
|
# uses: actions/cache@v2
|
||||||
|
# with:
|
||||||
|
# path: vendor
|
||||||
|
# key: ${{ runner.os }}-hhvm-${{ hashFiles('**/composer.lock') }}
|
||||||
|
# restore-keys: |
|
||||||
|
# ${{ runner.os }}-hhvm-
|
||||||
|
# - name: Validate composer configuration
|
||||||
|
# run: |
|
||||||
|
# composer validate
|
||||||
|
# - name: Install dependencies
|
||||||
|
# run: |
|
||||||
|
# composer install --no-progress
|
||||||
|
# - name: Run tests
|
||||||
|
# run: |
|
||||||
|
# composer run-script test
|
||||||
32
.travis.yml
32
.travis.yml
@ -1,32 +0,0 @@
|
|||||||
#see https://travis-ci.community/t/php-5-4-and-5-5-archives-missing/3723
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
|
|
||||||
language: php
|
|
||||||
|
|
||||||
# list any PHP version you want to test against
|
|
||||||
php:
|
|
||||||
- 5.4
|
|
||||||
- 5.5
|
|
||||||
- 5.6
|
|
||||||
- 7.0
|
|
||||||
- 7.1
|
|
||||||
- 7.2
|
|
||||||
- 7.3
|
|
||||||
- 7.4
|
|
||||||
- nightly
|
|
||||||
- hhvm
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
allow_failures:
|
|
||||||
- php: hhvm
|
|
||||||
- php: nightly
|
|
||||||
include:
|
|
||||||
- php: 5.3
|
|
||||||
dist: precise
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- composer install
|
|
||||||
|
|
||||||
# Script to run tests
|
|
||||||
script: composer test
|
|
||||||
@ -3,20 +3,20 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Simple, elegant, stand-alone validation library with NO dependencies",
|
"description": "Simple, elegant, stand-alone validation library with NO dependencies",
|
||||||
"keywords": ["validation", "validator", "valid"],
|
"keywords": ["validation", "validator", "valid"],
|
||||||
"homepage": "http://github.com/vlucas/valitron",
|
"homepage": "https://github.com/vlucas/valitron",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Vance Lucas",
|
"name": "Vance Lucas",
|
||||||
"email": "vance@vancelucas.com",
|
"email": "vance@vancelucas.com",
|
||||||
"homepage": "http://www.vancelucas.com"
|
"homepage": "https://www.vancelucas.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.2"
|
"php": ">=5.3.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^4.8.35 || ^5.5 || ^6.5"
|
"phpunit/phpunit": ">=4.8.35 <8"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-mbstring": "It can support the multiple bytes string length."
|
"ext-mbstring": "It can support the multiple bytes string length."
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
convertWarningsToExceptions="true"
|
convertWarningsToExceptions="true"
|
||||||
processIsolation="false"
|
processIsolation="false"
|
||||||
stopOnFailure="false"
|
stopOnFailure="false"
|
||||||
syntaxCheck="false"
|
|
||||||
bootstrap="tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
>
|
>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
@ -15,12 +14,4 @@
|
|||||||
<directory suffix="Test.php">tests/Valitron</directory>
|
<directory suffix="Test.php">tests/Valitron</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<filter>
|
|
||||||
<whitelist>
|
|
||||||
<directory suffix=".php">src/</directory>
|
|
||||||
</whitelist>
|
|
||||||
<blacklist>
|
|
||||||
<directory suffix=".php">vendor/</directory>
|
|
||||||
</blacklist>
|
|
||||||
</filter>
|
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
@ -627,7 +627,8 @@ class Validator
|
|||||||
if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46')) {
|
if (function_exists('idn_to_ascii') && defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||||
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
|
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
|
||||||
}
|
}
|
||||||
return checkdnsrr($domain, 'ANY');
|
|
||||||
|
return checkdnsrr($domain, 'MX');
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user