Skip to content

Commit e73b37a

Browse files
authored
Merge pull request #6 from BluePsyduck/feature/migrate-to-github-actions
feature/migrate-to-github-actions
2 parents c292d0d + 5cf99ca commit e73b37a

File tree

9 files changed

+177
-74
lines changed

9 files changed

+177
-74
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
/.github export-ignore
12
/test export-ignore
23

34
/.gitattributes export-ignore
45
/.gitignore export-ignore
5-
/.travis.yml export-ignore
66
/phpcs.xml export-ignore
77
/phpstan.neon export-ignore
8-
/phpunit.xml export-ignore
8+
/phpunit.xml export-ignore
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "phpunit-coverage-check",
5+
"pattern": [
6+
{
7+
"regexp": "(Total code coverage is .* % which is below the accepted .*)",
8+
"message": 1
9+
}
10+
]
11+
}
12+
]
13+
}

.github/workflows/ci.yaml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: CI
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '0 0 * * 0'
7+
8+
jobs:
9+
10+
unit-tests:
11+
name: Unit Tests
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php-version:
16+
- 7.2
17+
- 7.3
18+
- 7.4
19+
- 8.0
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
coverage: xdebug
30+
31+
- name: Get composer cache directory
32+
id: composer-cache
33+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
35+
- name: Cache composer dependencies
36+
uses: actions/cache@v2
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
40+
restore-keys: ${{ runner.os }}-composer-
41+
42+
- name: Setup problem matchers
43+
run: |
44+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
45+
echo "::add-matcher::.github/problem-matchers/coverage-check.json"
46+
47+
- name: Update dependencies
48+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
49+
50+
- name: Run phpunit
51+
run: vendor/bin/phpunit --testsuite unit-test --coverage-clover=coverage.xml
52+
53+
- name: Check coverage.xml existence
54+
id: check-coverage-file
55+
uses: andstor/file-existence-action@v1
56+
with:
57+
files: coverage.xml
58+
59+
- name: Run coverage-check
60+
if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }}
61+
run: vendor/bin/coverage-check coverage.xml 100
62+
63+
- name: Upload coverage as artifacts
64+
if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }}
65+
uses: actions/upload-artifact@v2
66+
with:
67+
name: coverage-${{ matrix.php-version }}
68+
path: coverage.xml
69+
70+
- name: Upload coverage to Codecov
71+
if: ${{ always() && steps.check-coverage-file.outputs.files_exists == 'true' }}
72+
uses: codecov/codecov-action@v1
73+
with:
74+
name: coverage-${{ matrix.php-version }}
75+
file: coverage.xml
76+
77+
coding-guidelines:
78+
name: Coding Guidelines
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: checkout
82+
uses: actions/checkout@v2
83+
84+
- name: Setup PHP
85+
uses: shivammathur/setup-php@v2
86+
with:
87+
php-version: 7.4
88+
tools: cs2pr
89+
coverage: none
90+
91+
- name: Get composer cache directory
92+
id: composer-cache
93+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
94+
95+
- name: Cache composer dependencies
96+
uses: actions/cache@v2
97+
with:
98+
path: ${{ steps.composer-cache.outputs.dir }}
99+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
100+
restore-keys: ${{ runner.os }}-composer-
101+
102+
- name: Update dependencies
103+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
104+
105+
- name: Run phpcs
106+
run: vendor/bin/phpcs -q --report=checkstyle | cs2pr
107+
108+
type-checker:
109+
name: Type Checker
110+
runs-on: ubuntu-latest
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v2
114+
115+
- name: Setup PHP
116+
uses: shivammathur/setup-php@v2
117+
with:
118+
php-version: 7.4
119+
coverage: none
120+
121+
- name: Get composer cache directory
122+
id: composer-cache
123+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
124+
125+
- name: Cache composer dependencies
126+
uses: actions/cache@v2
127+
with:
128+
path: ${{ steps.composer-cache.outputs.dir }}
129+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
130+
restore-keys: ${{ runner.os }}-composer-
131+
132+
- name: Update dependencies
133+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
134+
135+
- name: Run phpstan
136+
run: vendor/bin/phpstan analyse --no-interaction

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/test/log
33
/vendor
44

5+
/.phpunit.result.cache
56
/composer.lock

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Symfony Process Manager
22

3-
[![Latest Stable Version](https://poser.pugx.org/bluepsyduck/symfony-process-manager/v/stable)](https://packagist.org/packages/bluepsyduck/symfony-process-manager)
4-
[![License](https://poser.pugx.org/bluepsyduck/symfony-process-manager/license)](https://packagist.org/packages/bluepsyduck/symfony-process-manager)
5-
[![Build Status](https://travis-ci.com/BluePsyduck/symfony-process-manager.svg?branch=master)](https://travis-ci.com/BluePsyduck/symfony-process-manager)
6-
[![codecov](https://codecov.io/gh/BluePsyduck/symfony-process-manager/branch/master/graph/badge.svg)](https://codecov.io/gh/BluePsyduck/symfony-process-manager)
3+
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/BluePsyduck/symfony-process-manager)](https://github.com/BluePsyduck/symfony-process-manager/releases)
4+
[![GitHub](https://img.shields.io/github/license/BluePsyduck/symfony-process-manager)](LICENSE.md)
5+
[![build](https://img.shields.io/github/workflow/status/BluePsyduck/symfony-process-manager/CI?logo=github)](https://github.com/BluePsyduck/symfony-process-manager/actions)
6+
[![Codecov](https://img.shields.io/codecov/c/gh/BluePsyduck/symfony-process-manager?logo=codecov)](https://codecov.io/gh/BluePsyduck/symfony-process-manager)
77

88
This package provides a simple process manager class to be able to execute multiple processes with a specified limit
99
of parallel processes. The class expects the processes to use the [Symfony Process](https://github.com/symfony/process)

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
],
1414
"minimum-stability": "stable",
1515
"require": {
16-
"php": "^7.1",
16+
"php": "^7.2 || ^8.0",
1717
"symfony/process": "^3.0 || ^4.0 || ^5.0"
1818
},
1919
"require-dev": {
2020
"bluepsyduck/test-helper": "^1.0",
2121
"phpstan/phpstan": "^0.12",
2222
"phpstan/phpstan-phpunit": "^0.12",
2323
"phpstan/phpstan-strict-rules": "^0.12",
24-
"phpunit/phpunit": "^7.3",
24+
"phpunit/phpunit": "^8.0 || ^9.0",
2525
"rregeer/phpunit-coverage-check": "^0.3",
2626
"squizlabs/php_codesniffer": "^3.3"
2727
},

phpunit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" ?>
22
<phpunit colors="true">
33
<testsuites>
4-
<testsuite name="BluePsyduck\SymfonyProcessManager">
4+
<testsuite name="unit-test">
55
<directory>test/src</directory>
66
</testsuite>
77
</testsuites>
@@ -10,4 +10,4 @@
1010
<directory suffix=".php">src</directory>
1111
</whitelist>
1212
</filter>
13-
</phpunit>
13+
</phpunit>

0 commit comments

Comments
 (0)