Created
January 27, 2023 23:53
-
-
Save vstyler96/02c63edbfeb06d30b0e0f4c19d3d52ae to your computer and use it in GitHub Desktop.
Github Action for Laravel Dusk CI and PostgreSQL
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
| on: push | |
| name: Testing Laravel with PostgreSQL | |
| jobs: | |
| laravel: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| container: | |
| image: chilio/laravel-dusk-ci:latest | |
| services: | |
| redis: | |
| image: redis | |
| ports: | |
| - 6379/tcp | |
| options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| # mysql: | |
| # image: mariadb | |
| # env: | |
| # MYSQL_DATABASE: rank4dead | |
| # MYSQL_ROOT_PASSWORD: password | |
| # ports: | |
| # - 3306:3306 | |
| # options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_DB: rank4dead | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: password | |
| ports: | |
| - 5432/tcp | |
| options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install composer dependencies | |
| run: | | |
| composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts | |
| - name: Run Laravel Application | |
| run: | | |
| cp .env.ci .env | |
| composer dump-autoload | |
| php artisan key:generate | |
| php artisan storage:link | |
| php artisan migrate:fresh | |
| php artisan passport:install --force | |
| php artisan optimize:clear | |
| composer clear-cache | |
| - name: Run Tests | |
| run: ./vendor/bin/phpunit tests/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment