Skip to content

Commit

Permalink
ci: Update CI jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 14, 2021
1 parent b24b06c commit feb67ff
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 24 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/code-style.yml
@@ -0,0 +1,56 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request

name: "Code style"

jobs:
run:
name: "Code Style"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@2.11.0
with:
php-version: ${{ matrix.php-versions }}
extensions: gd,mbstring,pcov
tools: cs2pr

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

- name: Cache dependencies
uses: actions/cache@v2.1.6
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-progress --prefer-dist --optimize-autoloader

- name: Run Grumphp
run: vendor/bin/grumphp run --testsuite=cs -n

- name: Send feedback on Github
if: ${{ failure() }}
run: |
vendor/bin/php-cs-fixer --allow-risky=yes --config=.php_cs.dist fix --dry-run --format=checkstyle | cs2pr
62 changes: 62 additions & 0 deletions .github/workflows/static-analysis.yml
@@ -0,0 +1,62 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request
- push

name: "Static analysis"

jobs:
run:
name: "Static Analysis"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0']

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v2.3.4
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@2.11.0
with:
php-version: ${{ matrix.php-versions }}
extensions: gd,mbstring,pcov,xdebug
tools: cs2pr

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

- name: Cache dependencies
uses: actions/cache@v2.1.6
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-progress --prefer-dist --optimize-autoloader

- name: Run Grumphp
run: vendor/bin/grumphp run --tasks=psalm,phpstan -n

- name: Send feedback on Github
if: ${{ failure() }}
run: |
vendor/bin/phpstan analyse -l max --error-format=checkstyle src/ | cs2pr
vendor/bin/psalm --output-format=github | cs2pr
- name: Send PSALM data
run: vendor/bin/psalm --shepherd --stats src/
continue-on-error: true
Expand Up @@ -4,17 +4,17 @@ on:
- pull_request
- push

name: "Continuous Integration"
name: "Unit tests"

jobs:
run:
name: "Grumphp"
name: "Unit Tests"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest]
php-versions: ['7.4']
php-versions: ['7.4', '8.0']

steps:
- name: Set git to use LF
Expand All @@ -23,15 +23,15 @@ jobs:
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2.3.4
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/setup-php@master
uses: shivammathur/setup-php@2.11.0
with:
php-version: ${{ matrix.php-versions }}
extensions: xdebug,mbstring
extensions: gd,mbstring,pcov,xdebug

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -45,29 +45,13 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run Grumphp
run: vendor/bin/grumphp run

- name: Send PSALM data
run: vendor/bin/psalm --shepherd --stats src/
continue-on-error: true
run: vendor/bin/grumphp run --tasks=phpspec

- name: Send Scrutinizer data
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
continue-on-error: true

- name: Infection score report
run: |
vendor/bin/infection run -j 2
continue-on-error: true

- name: PHP Insights report
run: |
rm -rf composer.lock vendor
composer require nunomaduro/phpinsights --dev
vendor/bin/phpinsights analyse src/ -n
continue-on-error: true

0 comments on commit feb67ff

Please sign in to comment.