chore: tests (#8) #21
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: E2E tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
release: | |
types: [created] | |
jobs: | |
dusk-php: | |
name: Dusk | |
runs-on: ubuntu-latest | |
env: | |
APP_URL: "http://127.0.0.1:8000" | |
DB_USERNAME: root | |
DB_PASSWORD: root | |
MAIL_MAILER: log | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extensions: mbstring, dom, fileinfo, mysql | |
coverage: none | |
- name: Prepare The Environment | |
run: cp .env.dusk.ci .env | |
- name: Create Database | |
run: | | |
sudo systemctl start mysql | |
mysql --user="root" --password="root" -e "CREATE DATABASE \`shelter\` character set UTF8mb4 collate utf8mb4_bin;" | |
- name: Install Composer Dependencies | |
run: composer install --no-progress --prefer-dist --optimize-autoloader | |
- name: Generate Application Key | |
run: php artisan key:generate | |
- name: Run migrations | |
run: php artisan migrate --no-interaction -vvv | |
- name: Install dependencies | |
run: yarn install | |
- name: Build assets | |
run: yarn build | |
- name: Upgrade Chrome Driver | |
run: php artisan dusk:chrome-driver --detect | |
- name: Start Chrome Driver | |
run: ./vendor/laravel/dusk/bin/chromedriver-linux & | |
- name: Run Laravel Server | |
run: php artisan serve --no-reload & | |
- name: Run Dusk Tests | |
run: php artisan dusk | |
- name: Upload Screenshots | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: screenshots | |
path: tests/Browser/screenshots | |
- name: Upload Console Logs | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: console | |
path: tests/Browser/console |