fix: CI #11
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: Continuous integration | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
env: | |
APP_URL: "http://127.0.0.1:8000" | |
DB_USERNAME: root | |
DB_PASSWORD: root | |
DB_DATABASE: my-database | |
MAIL_MAILER: log | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Prepare The Environment | |
run: cp .env.example .env | |
- name: Create Database | |
run: | | |
sudo systemctl start mysql | |
mysql --user="root" --password="root" -e "CREATE DATABASE \`my-database\` 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 Laravel Server | |
run: php artisan serve --no-reload & | |
- name: Run Test | |
run: php artisan test --stop-on-failure --env=testing |