Skip to content

DE-51518: Adding GH actions #8

DE-51518: Adding GH actions

DE-51518: Adding GH actions #8

Workflow file for this run

name: CI
on: [pull_request, workflow_dispatch]
jobs:
phpstan:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- 7.4
composer-arg:
- install
- update --prefer-lowest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer ${{ matrix.composer-arg }} --prefer-dist
- name: Run PHPStan
run: composer phpstan
phpcs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- 7.4
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist
- name: Run PHP CodeSniffer
run: composer check-cs
phpunit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- 7.4
composer-arg:
- install
- update --prefer-lowest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer ${{ matrix.composer-arg }} --prefer-dist
- name: Run PHPUnit
run: composer phpunit