Merge pull request #171 from velstorelabs/feature/admin-validation-v2 #198
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: Laravel CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| extensions: mbstring, bcmath, sqlite, pdo_sqlite | |
| coverage: none | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| lint: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| - name: Install Laravel Pint | |
| run: composer global require laravel/pint | |
| - name: Run Pint | |
| run: ~/.composer/vendor/bin/pint --test | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| options: >- | |
| --health-cmd="mysqladmin ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=3 | |
| ports: | |
| - 3306:3306 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| extensions: mbstring, bcmath, sqlite, pdo_sqlite | |
| coverage: none | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest | |
| - name: Copy .env | |
| run: cp .env.example .env | |
| - name: Generate app key | |
| run: php artisan key:generate | |
| - name: Prepare SQLite database | |
| run: | | |
| touch database/database.sqlite | |
| php artisan migrate --no-interaction --force | |
| env: | |
| DB_CONNECTION: sqlite | |
| DB_DATABASE: database/database.sqlite | |
| - name: Run tests | |
| run: php artisan test | |
| env: | |
| DB_CONNECTION: sqlite | |
| DB_DATABASE: database/database.sqlite |