Skip to content

Commit

Permalink
ci: Update configuration files.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Aug 22, 2022
1 parent c12d32b commit 54e6896
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
57 changes: 25 additions & 32 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,56 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request
- push
push:
branches:
- master
pull_request:

name: "Continuous Integration"

jobs:
run:
name: "Grumphp"
supported-versions-matrix:
name: Supported Versions Matrix
runs-on: ubuntu-latest
outputs:
version: ${{ steps.supported-versions-matrix.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: supported-versions-matrix
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1
tests:
name: "Unit Tests"
runs-on: ${{ matrix.operating-system }}
needs:
- supported-versions-matrix
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: ['7.4', '8.1']

php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
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@master
with:
fetch-depth: 1
uses: actions/checkout@v3

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

- 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@v3.0.5
uses: shivammathur/setup-php@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
php-version: ${{ matrix.php }}
coverage: pcov

- name: Install dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
uses: ramsey/composer-install@v2

- name: Run Grumphp
run: vendor/bin/grumphp run
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

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

- 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
composer require scrutinizer/ocular --dev
vendor/bin/ocular code-coverage:upload --format=php-clover build/logs/coverage/clover.xml
continue-on-error: true
13 changes: 10 additions & 3 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
build:
image: default-bionic
nodes:
analysis:
php81:
environment:
php:
version: 7.4
version: 8.1
dependencies:
before:
- pecl install pcov
tests:
override:
- php-scrutinizer-run

coverage:
dependencies:
before:
- pecl install pcov
filter:
paths:
- 'src/*'
Expand Down

0 comments on commit 54e6896

Please sign in to comment.