Skip to content

Commit

Permalink
Merge pull request #9 from buhta/master
Browse files Browse the repository at this point in the history
Migrate to GHA
  • Loading branch information
wolfy-j committed Feb 8, 2020
2 parents 2345403 + d09f700 commit 6ab6784
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,58 @@
name: build

on: [push, pull_request]

jobs:
lint:
name: Check coding standards
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist
- name: Check CS
run: vendor/bin/spiral-cs check src tests
test:
needs: lint
name: Test PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist
- name: Execute Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# Proxy Factory
[![Latest Stable Version](https://poser.pugx.org/cycle/proxy-factory/version)](https://packagist.org/packages/cycle/proxy-factory)
[![Build Status](https://travis-ci.org/cycle/proxy-factory.svg?branch=master)](https://travis-ci.org/cycle/proxy-factory)
[![Build Status](https://github.com/cycle/proxy-factory/workflows/build/badge.svg)](https://github.com/cycle/proxy-factory/actions)
[![Codecov](https://codecov.io/gh/cycle/proxy-factory/branch/master/graph/badge.svg)](https://codecov.io/gh/cycle/proxy-factory/)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/cycle/proxy-factory/badges/quality-score.png)](https://scrutinizer-ci.com/g/cycle/proxy-factory/)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -13,7 +13,7 @@
},
"require-dev": {
"ext-pdo": "*",
"phpunit/phpunit": "~7.0",
"phpunit/phpunit": "~8.0",
"cycle/annotated": "^1.0",
"spiral/code-style": "^1.0",
"roave/security-advisories": "dev-master"
Expand Down

0 comments on commit 6ab6784

Please sign in to comment.