Skip to content

Commit

Permalink
Adds Github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebin committed Jan 28, 2020
1 parent 8069c88 commit 296ed0c
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 132 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI

on:
pull_request: null
push:
branches:
- master

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']
name: PHP ${{ matrix.php }} tests
steps:
- uses: actions/checkout@v2
# required for "git tag" presence for MonorepoBuilder split and ChangelogLinker git tags resolver; default is 1
- run: git fetch --depth=100000 origin
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
coverage: none
- run: composer install --no-progress
- run: composer phpunit

tests_lowest_dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=100000 origin
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.1
coverage: none
- run: composer update --no-progress --prefer-lowest
- run: composer phpunit

test_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=100000 origin
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.1
coverage: xdebug
- run: composer install --no-progress
- run : |
composer coverage
# codecov.io
bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: 'de38eee4-bbc9-43bc-811c-c96a7d6ec3b6'
ecs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none
- run: composer install --no-progress
- run: composer php-cs-fixer-dry-run

phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v1
with:
php-version: 7.3
coverage: none
- run: composer install --no-progress
- run: composer phpstan
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Travis (.org)](https://img.shields.io/travis/ddebin/atom-generator?logo=travis&style=for-the-badge)](https://travis-ci.org/ddebin/atom-generator)
![CI](https://img.shields.io/github/workflow/status/ddebin/atom-generator/CI?style=for-the-badge)
[![Codecov](https://img.shields.io/codecov/c/github/ddebin/atom-generator?logo=codecov&style=for-the-badge)](https://codecov.io/gh/ddebin/atom-generator)
![PHP from Packagist](https://img.shields.io/packagist/php-v/ddebin/atom-generator?logo=php&style=for-the-badge)
[![Packagist Version](https://img.shields.io/packagist/v/ddebin/atom-generator?style=for-the-badge)](https://packagist.org/packages/ddebin/atom-generator)
Expand Down
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@
}
},
"scripts": {
"test": "php-cs-fixer fix --allow-risky=yes && phpstan analyse -l 7 -c phpstan.neon src tests && phpunit",
"phpstan": "phpstan analyse -l 7 -c phpstan.neon src tests",
"phpunit": "phpunit"
"test": [
"@php-cs-fixer-dry-run",
"@phpstan",
"@phpunit"
],
"php-cs-fixer-dry-run": "php-cs-fixer fix --dry-run --allow-risky=yes",
"php-cs-fixer": "php-cs-fixer fix --allow-risky=yes",
"phpstan": "phpstan analyse -l max -c phpstan.neon src tests",
"phpunit": "phpunit",
"coverage": "phpunit --coverage-clover=clover.xml"
}
}
Loading

0 comments on commit 296ed0c

Please sign in to comment.