Change salas service to build from Dockerfile #23
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: Dusk Tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| dusk: | |
| runs-on: ubuntu-latest | |
| services: | |
| mariadb: | |
| image: mariadb:10.11 | |
| env: | |
| MARIADB_DATABASE: salas_dusk | |
| MARIADB_ROOT_PASSWORD: admin | |
| MARIADB_USER: admin | |
| MARIADB_PASSWORD: admin | |
| MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping --silent" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.3 | |
| extensions: mbstring, dom, pdo, mysql | |
| coverage: none | |
| - name: Install Composer dependencies | |
| run: composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Remove Dusk visual variables - usadas no modo assistido | |
| run: | | |
| sed -i '/DUSK_START_MAXIMIZED/d' .env.testing.example || true | |
| sed -i '/DUSK_HEADLESS_DISABLED/d' .env.testing.example || true | |
| - name: Copy testing env | |
| run: cp .env.testing.example .env | |
| - name: Generate APP_KEY | |
| run: php artisan key:generate | |
| - name: Wait for MariaDB | |
| run: | | |
| for i in {1..30}; do | |
| mysqladmin ping -h127.0.0.1 -P3306 --silent && break | |
| sleep 2 | |
| done | |
| - name: Run migrations | |
| run: php artisan migrate --force | |
| - name: Install Chrome | |
| uses: browser-actions/setup-chrome@v1 | |
| - name: Install ChromeDriver | |
| run: php artisan dusk:chrome-driver --detect | |
| - name: Start Laravel server | |
| run: php artisan serve --port=47800 & | |
| - name: Run Dusk | |
| run: php artisan dusk --without-tty |