main: laravel.yml updated. #6
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: run-tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: phpunit | |
runs-on: ubuntu-latest | |
container: | |
image: kirschbaumdevelopment/laravel-test-runner:8.1 | |
services: | |
mysql-service: | |
image: mysql:8.0 | |
env: | |
MYSQL_DATABASE: test | |
MYSQL_ALLOW_EMPTY_PASSWORD: true | |
## map the "external" 33306 port with the "internal" 3306 | |
ports: | |
- 33306:3306 | |
# Set health checks to wait until mysql database has started (it takes some seconds to start) | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Copy testing enviroment | |
run: cp .env.example .env.testing | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "8.1" | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: none | |
- name: Install composer dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Execute tests | |
env: | |
DB_PORT: 33306 | |
run: vendor/bin/phpunit |