toby/.github/workflows/test-and-lint-php.yml
Ewelina Lasowy 91bd46cc36
#17 - set up Laravel Dusk (#18)
* #17 - set up Laravel Dusk

* #17 - ecs fix

* #17 - fix

* #17 - fix

* #17 - fix

* #17 - fix

* Update .env.dusk.local

Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl>

Co-authored-by: Adrian Hopek <adrian.hopek@blumilk.pl>
Co-authored-by: Krzysztof Rewak <krzysztof.rewak@blumilk.pl>
2022-01-18 12:22:02 +01:00

52 lines
1.3 KiB
YAML

name: Test & lint PHP stuff
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test-and-lint-php:
name: Test & lint PHP stuff
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: toby
MYSQL_USER: toby
MYSQL_PASSWORD: password
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
- 3306:3306
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache dependencies
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-dependencies
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, intl
coverage: none
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
- name: Run PHP linter
run: composer ecs
- name: Execute tests
run: php artisan test --env=ci