Skip to content

Commit

Permalink
Merge b83c233 into 139d9ab
Browse files Browse the repository at this point in the history
  • Loading branch information
feryardiant committed Jun 10, 2021
2 parents 139d9ab + b83c233 commit a8c6d0c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
49 changes: 43 additions & 6 deletions .github/workflows/test.yml → .github/workflows/codes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Codes Quality

on:
pull_request:
Expand All @@ -8,7 +8,7 @@ on:
branches:
- master
paths:
- .github/workflows/test.yml
- .github/workflows/codes.yml
- src/*
- test/*

Expand All @@ -18,9 +18,48 @@ env:
CC_TEST_REPORTER_URL: https://codeclimate.com/downloads/test-reporter/test-reporter-0.7.0-linux-amd64

jobs:
analyze:
name: Analyze on PHP ${{ matrix.php-version }}
runs-on: ubuntu-20.04

strategy:
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1']

steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: phpstan, cs2pr

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-composer-

- name: Install dependencies
env:
phpVersion: ${{ matrix.php-version }}
run: composer install --prefer-dist --no-progress --no-suggest

- name: Static Analysis
run: phpstan analyse src --level 6 --no-progress --error-format=checkstyle | cs2pr

test:
name: Runs on PHP ${{ matrix.php-version }}
name: Test on PHP ${{ matrix.php-version }}
runs-on: ubuntu-20.04
needs: analyze
env:
GIT_COMMIT_SHA: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref }}
Expand All @@ -41,9 +80,7 @@ jobs:

- name: Get Composer cache directory
id: composer-cache
run: |
echo "GIT_BRANCH=$(echo ${GIT_BRANCH##*/} | tr / -)" >> $GITHUB_ENV
echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer dependencies
uses: actions/cache@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Version](https://img.shields.io/packagist/v/projek-xyz/container?style=flat-square)](https://packagist.org/packages/projek-xyz/container)
[![Lisence](https://img.shields.io/packagist/l/projek-xyz/container?style=flat-square)](https://github.com/projek-xyz/slim-plates/blob/master/LICENSE.md)
[![Actions Status](https://img.shields.io/github/workflow/status/projek-xyz/container/Tests/master?style=flat-square&logo=github-actions)](https://github.com/projek-xyz/container/actions)
[![Actions Status](https://img.shields.io/github/workflow/status/projek-xyz/container/Codes%20Quality/master?logo=github&style=flat-square)](https://github.com/projek-xyz/container/actions)
[![Coverage Status](https://img.shields.io/coveralls/github/projek-xyz/container/master?style=flat-square&logo=coveralls)](https://coveralls.io/github/projek-xyz/container)
[![Coverage Status](https://img.shields.io/codeclimate/coverage/projek-xyz/container?style=flat-square&logo=code-climate)](https://codeclimate.com/github/projek-xyz/container)
[![Maintainability](https://img.shields.io/codeclimate/maintainability/projek-xyz/container?style=flat-square&logo=code-climate)](https://codeclimate.com/github/projek-xyz/container/maintainability)
Expand Down

0 comments on commit a8c6d0c

Please sign in to comment.