1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/.github/workflows/phpunit.yml

107 lines
2.5 KiB
YAML
Raw Normal View History

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
name: phpunit
jobs:
phpunit:
2020-12-15 23:17:31 +01:00
runs-on: ubuntu-latest
2020-07-07 15:25:31 +02:00
strategy:
matrix:
2020-12-18 01:31:27 +01:00
operating-system: ['ubuntu-latest']
2020-12-15 22:03:20 +01:00
php-versions: ['7.3', '7.4']
2020-12-18 01:31:27 +01:00
- operating-system: 'ubuntu-latest'
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
NINJA_ENVIRONMENT: hosted
MULTI_DB_ENABLED: false
NINJA_LICENSE: 123456
TRAVIS: true
2020-09-07 01:29:46 +02:00
MAIL_MAILER: log
services:
mariadb:
image: mariadb:latest
ports:
- 3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_USER: ninja
MYSQL_PASSWORD: ninja
MYSQL_DATABASE: ninja
MYSQL_ROOT_PASSWORD: ninja
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- 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
- uses: actions/checkout@v1
with:
2020-10-15 12:45:23 +02:00
ref: v5-develop
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
php artisan cache:clear
php artisan config:cache
- name: Create DB and schemas
run: |
mkdir -p database
touch database/database.sqlite
- name: Migrate Database
run: |
php artisan migrate:fresh --seed --force && php artisan db:seed --force
- name: Prepare JS/CSS assets
run: |
npm i
npm run production
- name: Run Testsuite
run: |
cat .env
vendor/bin/phpunit --testdox
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}