GHYGEN

Generate GitHub Actions Config for Laravel Projects with Ghygen

Setup Database Service, use multiple PHP version, use multiple Laravel versions, build frontend, cache packages, execute Browser, Functional, and Unit tests…

MySql Service
Setup Mysql Service, for launching tests. It allows execute migrations and configure environment parameters.
Triggering Events
Select triggering events: manually or automatically, when the developer push the code on a specific branch, or a developer create a new Pull Request.
Matrix versions
Select multiple PHP versions (8.0, 7.4, 7.3), multiple Laravel versions (8, 7, 6).
Quality Check
Execute PHPunit tests, Code sniffer (PSR12), Static code analysis.

Ghygen allows you creating your Yaml file for GitHub Actions, for Laravel/PHP web application, so you can:

  • select triggering events: manually or automatically, when the developer push the code on a specific branch, or a developer create a new Pull Request;
  • select branches;
  • enable caching for all vendors;
  • enable caching PHP packages;
  • select multiple PHP versions (8.0, 7.4, 7.3);
  • select multiple Laravel versions (8, 7, 6), useful if you are developing a Laravel Package and you want to test it with multiple Laravel version;
  • select Node version for NPM (npm run something);
  • caching node packages;
  • setup Mysql service;
  • run migrations;
  • execute tests via phpunit;
  • static code analysis;
  • code sniffer (via phpcs for PSR12 compatibility);
  • validate Yaml file;
  • execute Browser Test via Laravel Dusk.

This is a Work In Progress, we are adding new features...

If you want to test and use quickly this tool, I deployed the codebase (main branch) on Digital Ocean Platform:

If you want to start using it locally you can clone the repo and install it following the instructions below.

Install

Clone source code, enter the new directory and perform a couple of instructions:

git clone https://github.com/Hi-Folks/gh-actions-yaml-generator.git
cd gh-actions-yaml-generator
cp .env.example .env
composer install
php artisan key:generate
npm i
npm run production

Then create your database and update the .env file with the right values for DB_* .

Once your Database is configured you can execute the migrations:

php artisan migrate

Start development server

php artisan serve

Open the browser to the URL: http://127.0.0.1:8000

Usage

Follow these steps:

  • access to the form (by default the URL is http://127.0.0.1:8000 if you run php artisan serve);
  • fill the form;
  • click on "Generate Yaml File" button.

github-actions-generator-laravel

Next, copy the content of your generated Yaml in a new file in your Laravel project .github/workflows/laravel_workflow.yaml .

Commit and push the new file.

If you configured "On - Push" you will see the running Actions in your Actions section of your GitHub project.