add automated test pipeline
This commit is contained in:
parent
2852efdcaa
commit
a71ccb522b
|
|
@ -8,11 +8,11 @@ APP_URL=http://192.168.15.195/laravel/bagisto/public
|
|||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=localhost
|
||||
DB_HOST=mysql
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=bagisto_testing
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=webkul
|
||||
DB_USERNAME=bagisto
|
||||
DB_PASSWORD=secret
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Run tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: bagisto_testing
|
||||
MYSQL_USER: bagisto
|
||||
MYSQL_PASSWORD: secret
|
||||
ports:
|
||||
- 3306
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup php
|
||||
uses: shivammathur/setup-php@v1
|
||||
with:
|
||||
php-version: '7.3'
|
||||
extensions: intl, curl, mbstring, openssl, pdo, pdo_mysql, tokenizer
|
||||
|
||||
- name: Set environment
|
||||
run: |
|
||||
set -e
|
||||
sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env.testing
|
||||
sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env.testing
|
||||
printf "the complete .env.testing ...\n\n"
|
||||
cat .env.testing
|
||||
|
||||
- name: Composer install
|
||||
run: |
|
||||
set -e
|
||||
composer global require hirak/prestissimo
|
||||
composer install --no-interaction --ansi --no-progress --no-suggest --optimize-autoloader
|
||||
|
||||
- name: Migrate database
|
||||
run: set -e && php artisan migrate --env=testing
|
||||
|
||||
- name: Execute unit tests
|
||||
run: set -e && vendor/bin/codecept run unit
|
||||
|
||||
- name: Execute functional tests
|
||||
run: set -e && vendor/bin/codecept run functional
|
||||
|
||||
- name: Execute trigger tests
|
||||
run: set -e && vendor/bin/codecept run trigger
|
||||
Loading…
Reference in New Issue