2020-07-26 17:57:36 -05:00
|
|
|
name: Laravel
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- develop
|
|
|
|
- feature/*
|
|
|
|
- features/*
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- develop
|
|
|
|
- feature/*
|
|
|
|
- features/*
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
prepare:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Copy .env
|
2020-07-30 23:57:38 -05:00
|
|
|
run: test -f .env || cp .env.ci .env
|
|
|
|
- name: Prepare dependencies
|
2020-07-26 17:57:36 -05:00
|
|
|
run: |
|
|
|
|
set -euxo pipefail
|
|
|
|
export PATH=$PATH:$HOME/.composer/vendor/bin/
|
|
|
|
composer global require hirak/prestissimo --no-plugins --no-scripts
|
|
|
|
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
|
|
|
|
|
|
|
touch ./storage/database/database.sqlite
|
2020-07-30 23:57:38 -05:00
|
|
|
- name: Prepare Firefly III
|
2020-07-26 17:57:36 -05:00
|
|
|
run: |
|
|
|
|
chmod -R 777 storage bootstrap/cache
|
|
|
|
php artisan migrate --seed
|
|
|
|
php artisan firefly-iii:upgrade-database
|
|
|
|
- name: Upload database
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: database
|
|
|
|
path: storage/database/database.sqlite
|
|
|
|
- name: Upload cache
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: cache
|
|
|
|
path: bootstrap/cache/
|
|
|
|
- name: Upload composer cache
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: composer
|
|
|
|
path: ~/.composer
|
|
|
|
|
|
|
|
laravel-tests:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Copy .env
|
2020-07-30 23:57:38 -05:00
|
|
|
run: test -f .env || cp .env.ci .env
|
2020-07-26 17:57:36 -05:00
|
|
|
- name: Download database
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: database
|
|
|
|
path: storage/database/database.sqlite
|
|
|
|
- name: Download cache
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: cache
|
|
|
|
path: bootstrap/cache/
|
|
|
|
- name: Download vendor
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: composer
|
|
|
|
path: ~/.composer
|
|
|
|
- name: install composer
|
|
|
|
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
|
|
|
|
|
|
|
- name: PHPUnit tests
|
|
|
|
uses: php-actions/phpunit@v1
|
|
|
|
with:
|
|
|
|
config: phpunit.xml
|
|
|
|
memory: 2048M
|
|
|
|
|
|
|
|
coding-standards:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Copy .env
|
2020-07-30 23:57:38 -05:00
|
|
|
run: test -f .env || cp .env.ci .env
|
2020-07-26 17:57:36 -05:00
|
|
|
- name: Download database
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: database
|
|
|
|
path: storage/database/database.sqlite
|
|
|
|
- name: Download cache
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: cache
|
|
|
|
path: bootstrap/cache/
|
|
|
|
- name: Download vendor
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: composer
|
|
|
|
path: ~/.composer
|
|
|
|
- name: install depenencies
|
|
|
|
run: |
|
|
|
|
composer global require nette/coding-standard
|
|
|
|
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
|
|
|
|
|
|
|
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
|
|
|
run: ecs check app tests --config ~/.composer/vendor/nette/coding-standard/coding-standard-php71.yml
|
|
|
|
|
|
|
|
phpstan:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- prepare
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Copy .env
|
2020-07-30 23:57:38 -05:00
|
|
|
run: test -f .env || cp .env.ci .env
|
2020-07-26 17:57:36 -05:00
|
|
|
- name: Download database
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: database
|
|
|
|
path: storage/database/database.sqlite
|
|
|
|
- name: Download cache
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: cache
|
|
|
|
path: bootstrap/cache/
|
|
|
|
- name: Download vendor
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: composer
|
|
|
|
path: ~/.composer
|
|
|
|
- name: install depenencies
|
|
|
|
run: |
|
|
|
|
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
|
|
|
|
|
|
|
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
|
|
|
run: vendor/bin/phpstan analyse
|