mirror of
https://github.com/Respect/Validation.git
synced 2024-04-24 19:10:40 +02:00
Configure continuous integration with GitHub actions
This commit will also remove Travis and Scrutinizer and will configure Codecov as a code coverage tool. A few changes in the PHPUnit configuration already had to be made before, but became more visible now. They're along with this commit. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
72dd88144e
commit
80ff37ca7f
116
.github/workflows/continuous-integration.yml
vendored
Normal file
116
.github/workflows/continuous-integration.yml
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'bin/**'
|
||||
- 'docs/**'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'bin/**'
|
||||
- 'docs/**'
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Tests
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "7.3"
|
||||
- "7.4"
|
||||
experimental: [false]
|
||||
include:
|
||||
- php-version: 8.0
|
||||
experimental: true
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
coverage: none
|
||||
extensions: uopz
|
||||
tools: pecl
|
||||
|
||||
- name: Install localisation files
|
||||
run: |
|
||||
sudo locale-gen --no-purge --lang nl_NL.UTF-8
|
||||
sudo locale-gen --no-purge --lang pt_BR.UTF-8
|
||||
sudo locale-gen --no-purge --lang ru_RU.UTF-8
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist
|
||||
|
||||
- name: Run unit tests
|
||||
run: vendor/bin/phpunit --testsuite=unit
|
||||
|
||||
- name: Run integration tests
|
||||
run: vendor/bin/phpunit --testsuite=integration
|
||||
|
||||
code-coverage:
|
||||
name: Code coverage
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 7.4
|
||||
coverage: pcov
|
||||
extensions: uopz
|
||||
tools: pecl
|
||||
|
||||
- name: Install localisation files
|
||||
run: |
|
||||
sudo locale-gen --no-purge --lang nl_NL.UTF-8
|
||||
sudo locale-gen --no-purge --lang pt_BR.UTF-8
|
||||
sudo locale-gen --no-purge --lang ru_RU.UTF-8
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist
|
||||
|
||||
- name: Generating code coverage report
|
||||
run: vendor/bin/phpunit --coverage-clover=coverage.xml
|
||||
|
||||
- name: Send code coverage report to Codecov.io
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
static-analysis:
|
||||
name: Static analysis
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 7.4
|
||||
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
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
.couscous/
|
||||
.phpcs.cache
|
||||
.phpunit.result.cache
|
||||
composer.lock
|
||||
Makefile
|
||||
phpcs.xml
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
filter:
|
||||
excluded_paths:
|
||||
- tests/*
|
||||
|
||||
checks:
|
||||
php:
|
||||
code_rating: true
|
||||
|
||||
tools:
|
||||
external_code_coverage: true
|
||||
php_analyzer: true
|
||||
php_changetracking: true
|
||||
php_code_sniffer:
|
||||
config:
|
||||
standard: "PSR2"
|
||||
php_cpd: true
|
||||
php_mess_detector: true
|
||||
php_pdepend: true
|
||||
sensiolabs_security_checker: true
|
||||
|
||||
build:
|
||||
environment:
|
||||
mysql: false
|
||||
postgresql: false
|
||||
mongodb: false
|
||||
elasticsearch: false
|
||||
redis: false
|
||||
memcached: false
|
||||
neo4j: false
|
||||
rabbitmq: false
|
||||
nodes:
|
||||
analysis:
|
||||
project_setup:
|
||||
override: true
|
||||
tests:
|
||||
override:
|
||||
- php-scrutinizer-run --enable-security-analysis
|
55
.travis.yml
55
.travis.yml
|
@ -1,55 +0,0 @@
|
|||
sudo: false
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 7.3
|
||||
- 7.4
|
||||
- nightly
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
before_install:
|
||||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
|
||||
|
||||
install:
|
||||
- travis_retry composer install
|
||||
- sudo locale-gen --no-purge --lang nl_NL.UTF-8
|
||||
- sudo locale-gen --no-purge --lang pt_BR.UTF-8
|
||||
- sudo locale-gen --no-purge --lang ru_RU.UTF-8
|
||||
- pecl install uopz || echo "Cound not install uopz" 1>&2
|
||||
|
||||
script:
|
||||
- vendor/bin/phpunit --testsuite=unit --verbose --colors
|
||||
- vendor/bin/phpunit --testsuite=integration --verbose --colors
|
||||
|
||||
jobs:
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
include:
|
||||
- stage: Quality assurance
|
||||
env: CODE_COVERAGE
|
||||
before_script:
|
||||
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
|
||||
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
|
||||
script: vendor/bin/phpunit --coverage-clover ./clover.xml
|
||||
after_script:
|
||||
- wget https://scrutinizer-ci.com/ocular.phar
|
||||
- php ocular.phar code-coverage:upload --format=php-clover ./clover.xml
|
||||
|
||||
- stage: Quality assurance
|
||||
env: DOCHEADER
|
||||
install: travis_retry composer install
|
||||
script: vendor/bin/docheader check library/ tests/
|
||||
|
||||
- stage: Quality assurance
|
||||
env: CODE_STANDARD
|
||||
install: travis_retry composer install
|
||||
script: vendor/bin/phpcs
|
||||
|
||||
- stage: Quality assurance
|
||||
env: STATIC_ANALYSIS
|
||||
install: travis_retry composer install
|
||||
script: vendor/bin/phpstan analyze
|
|
@ -1,8 +1,7 @@
|
|||
# Respect\Validation
|
||||
|
||||
[![Build Status](https://img.shields.io/travis/Respect/Validation/master.svg?style=flat-square)](http://travis-ci.org/Respect/Validation)
|
||||
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/Respect/Validation/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Respect/Validation/?branch=master)
|
||||
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Respect/Validation/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/Respect/Validation/?branch=master)
|
||||
[![Build Status](https://img.shields.io/github/workflow/status/Respect/Validation/Continuous%20Integration/master?style=flat-square)](https://github.com/Respect/Validation/actions?query=workflow%3A%22Continuous+Integration%22)
|
||||
[![Code Coverage](https://img.shields.io/codecov/c/github/Respect/Validation?style=flat-square)](https://codecov.io/gh/Respect/Validation)
|
||||
[![Latest Stable Version](https://img.shields.io/packagist/v/respect/validation.svg?style=flat-square)](https://packagist.org/packages/respect/validation)
|
||||
[![Total Downloads](https://img.shields.io/packagist/dt/respect/validation.svg?style=flat-square)](https://packagist.org/packages/respect/validation)
|
||||
[![License](https://img.shields.io/packagist/l/respect/validation.svg?style=flat-square)](https://packagist.org/packages/respect/validation)
|
||||
|
|
|
@ -1,19 +1,26 @@
|
|||
<phpunit bootstrap="vendor/autoload.php"
|
||||
<?xml version="1.0"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
cacheTokens="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
verbose="true">
|
||||
<testsuites>
|
||||
<testsuite name="unit">
|
||||
<directory suffix="Test.php">tests/unit/</directory>
|
||||
</testsuite>
|
||||
<testsuite name="integration">
|
||||
<directory suffix=".phpt">tests/integration/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<testsuites>
|
||||
<testsuite name="unit">
|
||||
<directory suffix="Test.php">tests/unit/</directory>
|
||||
</testsuite>
|
||||
<testsuite name="integration">
|
||||
<directory suffix=".phpt">tests/integration/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage processUncoveredFiles="true" ignoreDeprecatedCodeUnits="true">
|
||||
<include>
|
||||
<directory suffix=".php">library/</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
</phpunit>
|
||||
|
|
Loading…
Reference in a new issue