2020-03-25 14:03:23 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-10-15 11:45:41 +02:00
|
|
|
- v5-develop
|
2020-08-06 02:16:28 +02:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2020-10-15 11:45:41 +02:00
|
|
|
- v5-develop
|
2020-03-25 14:03:23 +01:00
|
|
|
|
|
|
|
name: phpunit
|
|
|
|
jobs:
|
|
|
|
phpunit:
|
|
|
|
runs-on: ubuntu-latest
|
2020-07-07 15:25:31 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-08-17 11:28:59 +02:00
|
|
|
php-versions: ['7.3', '7.4', '8.0']
|
2020-03-26 04:23:57 +01:00
|
|
|
env:
|
|
|
|
DB_DATABASE1: ninja
|
|
|
|
DB_USERNAME1: root
|
|
|
|
DB_PASSWORD1: ninja
|
|
|
|
DB_HOST1: '127.0.0.1'
|
|
|
|
DB_DATABASE: ninja
|
|
|
|
DB_USERNAME: root
|
|
|
|
DB_PASSWORD: ninja
|
|
|
|
DB_HOST: '127.0.0.1'
|
|
|
|
BROADCAST_DRIVER: log
|
|
|
|
CACHE_DRIVER: file
|
|
|
|
QUEUE_CONNECTION: sync
|
|
|
|
SESSION_DRIVER: file
|
2020-05-14 11:08:49 +02:00
|
|
|
NINJA_ENVIRONMENT: hosted
|
2020-03-28 12:34:04 +01:00
|
|
|
MULTI_DB_ENABLED: false
|
2020-04-15 02:30:52 +02:00
|
|
|
NINJA_LICENSE: 123456
|
2020-03-29 14:22:14 +02:00
|
|
|
TRAVIS: true
|
2020-09-07 01:29:46 +02:00
|
|
|
MAIL_MAILER: log
|
2020-03-29 14:22:14 +02:00
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
services:
|
2020-03-26 04:23:57 +01:00
|
|
|
mariadb:
|
|
|
|
image: mariadb:latest
|
|
|
|
ports:
|
|
|
|
- 3306
|
2020-03-25 14:03:23 +01:00
|
|
|
env:
|
2020-03-26 04:23:57 +01:00
|
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
|
|
MYSQL_USER: ninja
|
|
|
|
MYSQL_PASSWORD: ninja
|
2020-03-25 14:03:23 +01:00
|
|
|
MYSQL_DATABASE: ninja
|
2020-03-26 04:23:57 +01:00
|
|
|
MYSQL_ROOT_PASSWORD: ninja
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
2020-03-25 14:03:23 +01:00
|
|
|
|
|
|
|
steps:
|
2020-03-26 04:23:57 +01:00
|
|
|
- name: Start mysql service
|
|
|
|
run: |
|
|
|
|
sudo /etc/init.d/mysql start
|
|
|
|
|
|
|
|
- name: Verify MariaDB connection
|
|
|
|
env:
|
|
|
|
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
|
|
|
|
DB_PORT1: ${{ job.services.mariadb.ports[3306] }}
|
|
|
|
|
|
|
|
run: |
|
|
|
|
while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
- uses: actions/checkout@v1
|
|
|
|
with:
|
2020-10-15 12:45:23 +02:00
|
|
|
ref: v5-develop
|
2020-03-25 14:03:23 +01:00
|
|
|
fetch-depth: 1
|
|
|
|
|
|
|
|
- name: Copy .env
|
|
|
|
run: |
|
|
|
|
cp .env.ci .env
|
|
|
|
|
|
|
|
- name: Install composer dependencies
|
|
|
|
run: |
|
|
|
|
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
composer install
|
|
|
|
|
|
|
|
- name: Prepare Laravel Application
|
|
|
|
run: |
|
|
|
|
php artisan key:generate
|
|
|
|
php artisan optimize
|
2020-03-26 04:23:57 +01:00
|
|
|
php artisan cache:clear
|
|
|
|
php artisan config:cache
|
2020-03-28 12:34:04 +01:00
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
- name: Create DB and schemas
|
|
|
|
run: |
|
|
|
|
mkdir -p database
|
|
|
|
touch database/database.sqlite
|
|
|
|
|
|
|
|
- name: Migrate Database
|
|
|
|
run: |
|
2020-05-20 00:49:58 +02:00
|
|
|
php artisan migrate:fresh --seed --force && php artisan db:seed --force
|
2020-03-25 14:03:23 +01:00
|
|
|
|
2020-03-26 04:23:57 +01:00
|
|
|
- name: Prepare JS/CSS assets
|
|
|
|
run: |
|
|
|
|
npm i
|
|
|
|
npm run production
|
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
- name: Run Testsuite
|
2020-03-28 12:34:04 +01:00
|
|
|
run: |
|
|
|
|
cat .env
|
|
|
|
vendor/bin/phpunit --testdox
|
2020-03-26 04:23:57 +01:00
|
|
|
env:
|
|
|
|
DB_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
|
|
|