update permission seeder #108
Workflow file for this run
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
name: Tests | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
types: | |
- synchronize | |
- opened | |
- edited | |
- reopened | |
jobs: | |
test: | |
# Setup ubuntu latest | |
runs-on: ubuntu-latest | |
# Service containers to run with `container-job` | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: laravel | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [8.0, 8.1] | |
laravel: ["8.*"] | |
laravel-require: [8.0] | |
mysql-version: [8.0] | |
badaso-core: [2.x] | |
name: "PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}" | |
steps: | |
- uses: actions/checkout@master | |
# Configure Mysql | |
- name: Mysql setup | |
uses: ankane/setup-mysql@v1 | |
with: | |
mysql-version: ${{ matrix.mysql-version }} | |
database: laravel | |
# Configure PHP | |
- name: Select PHP version | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: "${{ matrix.php }}" | |
extensions: mbstring, pdo_sqlite, fileinfo, gd, php_pgsql | |
coverage: none | |
# Install legacy factories for Laravel 8/9 | |
- name: Install legacy factories for Laravel | |
run: composer create-project laravel/laravel:^${{matrix.laravel-require}} laravel | |
# Display installed laravel version | |
- name: Show laravel version | |
run: cd laravel && | |
composer show laravel/framework && | |
php artisan db:wipe | |
# Laravel require badaso core and badaso content module | |
- name: Laravel file configuration | |
run: git branch && | |
cd laravel && | |
composer require badaso/core:^2.0 -W && | |
composer require badaso/content-module:dev-${GITHUB_HEAD_REF} && | |
composer update --no-interaction -W | |
# Mysql | Laravel setup | |
- name: Mysql | Laravel setup | |
run: cd laravel && | |
php artisan badaso:setup --force && | |
php artisan badaso-content:setup && | |
php artisan badaso-content-test:setup && | |
php artisan db:wipe && | |
php artisan migrate && | |
php artisan db:seed --class="Database\Seeders\Badaso\BadasoSeeder" && | |
php artisan db:seed --class="Database\Seeders\Badaso\Content\BadasoContentModuleSeeder" && | |
sed -i 's/MIX_BADASO_MENU=${MIX_DEFAULT_MENU}/MIX_BADASO_MENU=${MIX_DEFAULT_MENU},content-module/g' .env && | |
sed -i 's/MIX_BADASO_PLUGINS=/MIX_BADASO_PLUGINS=content-module/g' .env && | |
key=$(eval "php artisan jwt:secret -s") && | |
sed -i 's/JWT_SECRET=/JWT_SECRET="'${key}'"/g' .env | |
# Mysql | Badaso Content Module test | |
- name: Mysql | Badaso Content Module test | |
run: cd laravel && php artisan test | |
# Sqlite | Laravel configuration | |
- name: Sqlite | Laravel file configuration | |
run: cd laravel && | |
touch database/database.sqlite && | |
sed -i 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/g' .env && | |
sed -i 's/DB_DATABASE=laravel/DB_DATABASE=database\/database.sqlite/g' .env | |
# Sqlite | Laravel setup | |
- name: Sqlite | Laravel setup | |
run: cd laravel && | |
php artisan badaso:setup --force && | |
php artisan badaso-content:setup && | |
php artisan badaso-content-test:setup && | |
php artisan db:wipe && | |
php artisan migrate && | |
php artisan db:seed --class="Database\Seeders\Badaso\BadasoSeeder" && | |
php artisan db:seed --class="Database\Seeders\Badaso\Content\BadasoContentModuleSeeder" | |
# Sqlite | Badaso Content Module test | |
- name: Sqlite | Badaso Content Module test | |
run: cd laravel && php artisan test | |
# Pgsql | Laravel configuration | |
- name: Pgsql | Laravel file configuration | |
run: cd laravel && | |
sed -i 's/DB_CONNECTION=sqlite/DB_CONNECTION=pgsql/g' .env && | |
sed -i 's/DB_DATABASE=database\/database.sqlite/DB_DATABASE=laravel/g' .env && | |
sed -i 's/DB_PASSWORD=/DB_PASSWORD=postgres/g' .env && | |
sed -i 's/DB_HOST=127.0.0.1/DB_HOST=localhost/g' .env && | |
sed -i 's/DB_USERNAME=root/DB_USERNAME=postgres/g' .env && | |
sed -i 's/DB_PORT=3306/DB_PORT=5432/g' .env | |
# Pgsql | Laravel setup | |
- name: Pgsql | Laravel setup | |
run: cd laravel && | |
php artisan badaso:setup --force && | |
php artisan badaso-content:setup && | |
php artisan badaso-content-test:setup && | |
php artisan db:wipe && | |
php artisan migrate && | |
php artisan db:seed --class="Database\Seeders\Badaso\BadasoSeeder" && | |
php artisan db:seed --class="Database\Seeders\Badaso\Content\BadasoContentModuleSeeder" | |
# Pgsql | Badaso Content Module test | |
- name: Pgsql | Badaso Content Module test | |
run: cd laravel && php artisan test |