Merge pull request #296 from EscolaLMS/develop #821
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: push | |
name: Integration Tests | |
jobs: | |
phpunit-mysql: | |
runs-on: ubuntu-latest | |
container: | |
image: escolalms/php:8-work | |
services: | |
mysql: | |
image: mariadb:10.5 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: test | |
ports: | |
- 33306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Copy environment configuration files | |
run: | | |
cp docker/envs/.env.ci.mysql .env | |
cp docker/envs/.env.ci.mysql .env.testing | |
cp docker/envs/phpunit.xml.mysql phpunit.xml | |
- name: Update composer | |
run: | | |
apt-get install unzip -y | |
composer self-update | |
composer install --no-scripts | |
- name: Prepare Laravel Application | |
run: | | |
php artisan key:generate | |
php artisan migrate:fresh | |
php artisan db:seed --class="Database\Seeders\PermissionsSeeder" | |
php artisan passport:keys --force | |
php artisan passport:client --personal --no-interaction | |
cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key | |
cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key | |
mkdir vendor/escolalms/lrs/src/../../storage/ | |
cp storage/*.key vendor/escolalms/lrs/src/../../storage/ | |
- name: Special Migrations for Tests | |
run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations | |
- name: Run Testsuite | |
run: vendor/bin/phpunit | |
phpunit-postgres: | |
runs-on: ubuntu-latest | |
container: | |
image: escolalms/php:8-work | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test | |
TZ: Europe/Warsaw | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Copy environment configuration files | |
run: | | |
cp docker/envs/.env.ci.postgres .env | |
cp docker/envs/phpunit.xml.postgres phpunit.xml | |
- name: Install composer dependencies | |
run: | | |
apt-get -y install git | |
apt-get install unzip | |
composer self-update | |
composer install --no-scripts | |
- name: Prepare Laravel Application | |
run: | | |
php artisan key:generate | |
php artisan migrate:fresh | |
php artisan db:seed --class="Database\Seeders\PermissionsSeeder" | |
php artisan passport:keys --force | |
php artisan passport:client --personal --no-interaction | |
cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key | |
cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key | |
mkdir vendor/escolalms/lrs/src/../../storage/ | |
cp storage/*.key vendor/escolalms/lrs/src/../../storage/ | |
- name: Special Migrations for Tests | |
run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations | |
- name: Run Testsuite | |
run: vendor/bin/phpunit | |
phpunit-postgres-php81: | |
runs-on: ubuntu-latest | |
container: | |
image: escolalms/php:8.1-work | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test | |
TZ: Europe/Warsaw | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Copy environment configuration files | |
run: | | |
cp docker/envs/.env.ci.postgres .env | |
cp docker/envs/phpunit.xml.postgres phpunit.xml | |
- name: Update composer | |
run: | | |
apt-get install git unzip -y | |
composer self-update | |
composer install --no-scripts | |
- name: Prepare Laravel Application | |
run: | | |
php artisan key:generate | |
php artisan migrate:fresh | |
php artisan db:seed --class="Database\Seeders\PermissionsSeeder" | |
php artisan passport:keys --force | |
php artisan passport:client --personal --no-interaction | |
cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key | |
cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key | |
mkdir vendor/escolalms/lrs/src/../../storage/ | |
cp storage/*.key vendor/escolalms/lrs/src/../../storage/ | |
- name: Special Migrations for Tests | |
run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations | |
- name: Run Testsuite | |
run: vendor/bin/phpunit | |
phpunit-postgres-php82: | |
runs-on: ubuntu-latest | |
container: | |
image: escolalms/php:8.2-work | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: test | |
TZ: Europe/Warsaw | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Copy environment configuration files | |
run: | | |
cp docker/envs/.env.ci.postgres .env | |
cp docker/envs/phpunit.xml.postgres phpunit.xml | |
- name: Update composer | |
run: | | |
apt-get install git unzip -y | |
composer self-update | |
composer install --no-scripts | |
- name: Prepare Laravel Application | |
run: | | |
php artisan key:generate | |
php artisan migrate:fresh | |
php artisan db:seed --class="Database\Seeders\PermissionsSeeder" | |
php artisan passport:keys --force | |
php artisan passport:client --personal --no-interaction | |
cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key | |
cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key | |
mkdir vendor/escolalms/lrs/src/../../storage/ | |
cp storage/*.key vendor/escolalms/lrs/src/../../storage/ | |
- name: Special Migrations for Tests | |
run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations | |
- name: Run Testsuite | |
run: vendor/bin/phpunit |