Tests | Mysql #250
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: Tests | Mysql | |
on: | |
push: | |
branches: | |
- master | |
- "*" | |
pull_request: | |
schedule: | |
- cron: "0 0 * * *" | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.2, 8.3] | |
name: PHP ${{ matrix.php }} | |
steps: | |
- name: Shutdown Ubuntu MySQL (SUDO) | |
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it | |
- uses: mirromutth/mysql-action@v1.1 | |
with: | |
mysql root password: "secret" # Required if "mysql user" is empty, default is empty. The root superuser password | |
mysql database: "some_test" | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_mysql | |
coverage: none | |
- name: Install Composer dependencies | |
run: composer install --prefer-dist --no-interaction --no-progress | |
- name: Execute tests | |
env: | |
APP_ENV: testing | |
DB_CONNECTION: mysql | |
DB_HOST: 127.0.0.1 | |
DB_PORT: 3306 | |
DB_DATABASE: some_test | |
DB_USERNAME: root | |
DB_PASSWORD: secret | |
run: php artisan test |