Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions #15

Merged
merged 3 commits into from
Dec 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions .circleci/config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These are supported funding model platforms
github: [phpgt]
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on: [push]

jobs:
composer:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v5

- name: Archive build
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./

- name: Upload build archive for test runners
uses: actions/upload-artifact@v2
with:
name: build-artifact
path: /tmp/github-actions

phpunit:
runs-on: ubuntu-latest
needs: [composer]

steps:
- uses: actions/download-artifact@v2
with:
name: build-artifact
path: /tmp/github-actions

- name: Extract build archive
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Unit tests
uses: php-actions/phpunit@v2
with:
php_version: 8.0
php_extensions: xdebug
configuration: test/phpunit/phpunit.xml
bootstrap: vendor/autoload.php

phpstan:
runs-on: ubuntu-latest
needs: [composer]

steps:
- uses: actions/download-artifact@v2
with:
name: build-artifact
path: /tmp/github-actions

- name: Extract build archive
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Static Analysis
uses: php-actions/phpstan@v2
with:
path: src/
31 changes: 21 additions & 10 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
build:
environment:
php:
version: 7.4
tests:
override:
-
command: 'vendor/bin/phpunit test/unit --coverage-clover coverage --whitelist src'
coverage:
file: 'coverage'
format: 'php-clover'
php: 8.0.0

nodes:
analysis:
tests:
override:
- php-scrutinizer-run

tests-and-coverage:
environment:
php:
ini:
"xdebug.mode": coverage
tests:
override:
- phpcs-run ./src
- command: "vendor/bin/phpunit test/phpunit --coverage-clover test/phpunit/_coverage --whitelist src"
coverage:
file: "test/phpunit/_coverage"
format: "php-clover"

checks:
php:
Expand All @@ -18,4 +29,4 @@ checks:
filter:
excluded_paths:
- test/*
- vendor/*
- vendor/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Execute background processes asynchronously using an object oriented process poo

***

<a href="https://circleci.com/gh/PhpGt/Daemon" target="_blank">
<a href="https://github.com/PhpGt/Daemon/actions" target="_blank">
<img src="https://badge.status.php.gt/daemon-build.svg" alt="Build status" />
</a>
<a href="https://scrutinizer-ci.com/g/PhpGt/Daemon" target="_blank">
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": "8.*"
"phpunit/phpunit": "9.*"
},

"autoload": {
Expand All @@ -16,7 +16,7 @@
},
"autoload-dev": {
"psr-4": {
"Gt\\Daemon\\Test\\": "./test/unit"
"Gt\\Daemon\\Test\\": "./test/phpunit"
}
}
}
Loading