move test and lint workflows to GitHub Actions
This commit is contained in:
40
.github/workflows/lint.yml
vendored
Normal file
40
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/composer-cache
|
||||
key: ${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
uses: php-actions/composer@v5
|
||||
with:
|
||||
command: install
|
||||
args: --prefer-dist --no-progress --no-suggest --verbose
|
||||
php_version: ${{ matrix.php-versions }}
|
||||
version: 1
|
||||
|
||||
- name: Run lint
|
||||
run: make lint
|
||||
40
.github/workflows/test.yml
vendored
Normal file
40
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
pull_request:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php-versions: ['7.0', '7.1', '7.2', '7.3', '7.4']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/composer-cache
|
||||
key: ${{ runner.os }}-php${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
uses: php-actions/composer@v5
|
||||
with:
|
||||
command: install
|
||||
args: --prefer-dist --no-progress --no-suggest --verbose
|
||||
php_version: ${{ matrix.php-versions }}
|
||||
version: 1
|
||||
|
||||
- name: Run tests
|
||||
run: make test
|
||||
24
.travis.yml
24
.travis.yml
@@ -1,24 +0,0 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4
|
||||
- nightly
|
||||
|
||||
jobs:
|
||||
allow_failures:
|
||||
- php: 7.4
|
||||
- php: nightly
|
||||
|
||||
before_install:
|
||||
- composer self-update
|
||||
|
||||
install:
|
||||
- travis_retry composer install --no-interaction --prefer-source
|
||||
|
||||
script:
|
||||
- make lint
|
||||
- make test
|
||||
13
Makefile
13
Makefile
@@ -1,17 +1,14 @@
|
||||
THIS := $(realpath $(lastword $(MAKEFILE_LIST)))
|
||||
HERE := $(shell dirname $(THIS))
|
||||
|
||||
.PHONY: all fix lint test
|
||||
|
||||
all: lint test
|
||||
|
||||
fix:
|
||||
php $(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs
|
||||
php vendor/bin/php-cs-fixer fix --config=.php_cs
|
||||
|
||||
lint:
|
||||
php $(HERE)/vendor/bin/php-cs-fixer fix --config=$(HERE)/.php_cs --dry-run
|
||||
php $(HERE)/vendor/bin/phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode
|
||||
php $(HERE)/vendor/bin/phpmd tests/ text cleancode,codesize,controversial,design,naming,unusedcode
|
||||
php vendor/bin/php-cs-fixer fix --config=.php_cs --dry-run
|
||||
php vendor/bin/phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode
|
||||
php vendor/bin/phpmd tests/ text cleancode,codesize,controversial,design,naming,unusedcode
|
||||
|
||||
test:
|
||||
php $(HERE)/vendor/bin/phpunit --configuration $(HERE)/phpunit.xml
|
||||
php vendor/bin/phpunit --configuration phpunit.xml
|
||||
|
||||
Reference in New Issue
Block a user