Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/592 #598

Merged
merged 12 commits into from
Nov 22, 2021
52 changes: 52 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PHP Static Analysis & Tests

on:
push:
branches: [ develop, 'issue/592' ]
Sebbo94BY marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
branches: [ develop ]
Sebbo94BY marked this conversation as resolved.
Show resolved Hide resolved

jobs:
static-analysis:
name: Static Analysis
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
Sebbo94BY marked this conversation as resolved.
Show resolved Hide resolved
php-versions: ['7.2.0', '7.2', '7.3', '7.4']

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

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

- name: Cache Files
uses: actions/cache@v2
with:
path: |
${{ steps.composer-cache.outputs.dir }}
**/.php_cs.cache
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run static analysis
run: composer run static-analysis

- name: Run tests
run: ./vendor/bin/phpunit --testdox --stop-on-failure