Added Role and Permission implementation along with policies, middlew… #18
This file contains hidden or 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: | |
| - develop | |
| - main | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.2 | |
| tools: composer:v2 | |
| coverage: xdebug | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.12' | |
| cache: 'npm' | |
| - name: Install Node Dependencies | |
| run: npm ci | |
| - name: Install Dependencies | |
| run: composer install --no-interaction --prefer-dist --optimize-autoloader | |
| - name: Copy Environment File | |
| run: cp .env.example .env | |
| - name: Configure Database for CI | |
| run: | | |
| echo "DB_CONNECTION=sqlite" >> .env | |
| echo "DB_DATABASE=database/database.sqlite" >> .env | |
| - name: Create SQLite database | |
| run: touch database/database.sqlite | |
| - name: Generate Application Key | |
| run: php artisan key:generate | |
| - name: Create storage directories | |
| run: | | |
| mkdir -p storage/framework/cache | |
| mkdir -p storage/framework/sessions | |
| mkdir -p storage/framework/testing | |
| mkdir -p storage/framework/views | |
| mkdir -p storage/logs | |
| chmod -R 775 storage | |
| chmod -R 775 bootstrap/cache | |
| - name: Run Migrations | |
| run: php artisan migrate --env=testing --no-interaction | |
| - name: Clear cache | |
| run: php artisan cache:clear | |
| - name: Route cache | |
| run: php artisan route:clear | |
| - name: Config cache | |
| run: php artisan config:clear | |
| - name: Generate Wayfinder routes | |
| run: php artisan wayfinder:generate | |
| - name: Build Assets | |
| run: npm run build | |
| - name: Tests | |
| run: ./vendor/bin/phpunit |