Skip to content

Commit

Permalink
Update CI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b authored Dec 23, 2020
1 parent c274b68 commit 7e994c8
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 57 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,64 @@ name: CI
on: [push]

jobs:
build:
composer:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: php-actions/composer@dynamic-docker
- 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: Upload build for test runner
- 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: ./
path: /tmp/github-actions

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

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

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

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

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

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

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

- name: PHP Static Analysis
uses: php-actions/phpstan@dynamic-docker
uses: php-actions/phpstan@v2
with:
path: src/
32 changes: 32 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
build:
environment:
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:
code_rating: true
duplication: true

filter:
excluded_paths:
- test/*
- vendor/*
Loading

0 comments on commit 7e994c8

Please sign in to comment.