Skip to content

Commit

Permalink
Update CI (#42)
Browse files Browse the repository at this point in the history
* Update CI

* Add PHPStan

* Upgrade and fix tests

* Remove stub class
  • Loading branch information
g105b authored Dec 23, 2020
1 parent 80683ce commit 6599d5c
Show file tree
Hide file tree
Showing 10 changed files with 914 additions and 461 deletions.
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/
29 changes: 20 additions & 9 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
build:
environment:
php:
version: 7.2.0
tests:
override:
-
command: 'vendor/bin/phpunit test/phpunit --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 Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

"require": {
"php": ">=7.2",
"phpgt/cookie": "*",
"phpgt/input": "*",
"phpgt/cookie": "1.*",
"phpgt/input": "1.*",
"psr/http-message": "^1.0.1",
"willdurand/negotiation": "^2.3"
"willdurand/negotiation": "3.0.*"
},
"require-dev": {
"phpunit/phpunit": "8.*"
"phpunit/phpunit": "9.*",
"phpstan/phpstan": ">=0.12.64"
},

"autoload": {
Expand Down
Loading

0 comments on commit 6599d5c

Please sign in to comment.