DEV Community

Cover image for Maghic: a Swiss army knife for GitHub Actions Workflow
Roberto B.
Roberto B.

Posted on • Updated on

Maghic: a Swiss army knife for GitHub Actions Workflow

Maghic is a Swiss army knife tool for GitHub Actions Workflow.

This is created for the GitHub Actions Hackathon: 2021 GitHub Actions Hackathon on DEV

My Workflow

Maghic provides:

  • a command line tool for managing, creating and autogenerate Yaml file Workflow for GitHub Actions;
  • a set of classes and methods for managing Yaml file (specific for GitHub Actions Workflows).

You can create your GitHub Actions workflow with some code like this one:

$yaml=\App\Objects\YamlObject::make()
        ->setName("My Test Name")
        ->setOnPushDefaultBranches()
        ->addMysqlService()
        ->addMatrixOsUbuntuLatest()
        ->toString();
Enter fullscreen mode Exit fullscreen mode

OR you can use a command for:

  • Checking the syntax of the workflow file (maghic yaml:check);
  • Edit the workflow file with a wizard (maghic yaml:edit);
  • Generate automatically the workflow for your project (maghic yaml:guess).

How to generate automatically the workflow

You can create automatically your workflow for your project with the command:

./maghic yaml:guess --save ../yourprojects
Enter fullscreen mode Exit fullscreen mode

Generate automatically the GitHub Actions Workflow file

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

GitHub logo Hi-Folks / maghic

Maghic is a Swiss army knife for GitHub Actions Workflow

Maghic

Maghic

Maghic is a Swiss army knife tool for GitHub Actions Workflow.

This project is a W.I.P. for "2021 GitHub Actions Hackathon on DEV". It is not yet completed and it is under development as side project.

It provides:

  • a command line tool for managing, creating and autogenerate Yaml file Workflow for GitHub Actions;
  • a set of classes and methods for managing Yaml file (specific for GitHub Actions Workflows).

This is created for the GitHub Actions Hackathon: 2021 GitHub Actions Hackathon on DEV

Auto generate workflows

If you want to create automatically a GitHub Actions workflow file you can execute "maghic yaml:guess" command If you want to save the file, you need to use --save option Amandatory argument is the directory of the project that needs a workflow file If you want to enable a MySql service, you need to use --mysql option.

./maghic yaml:guess --mysql --save .
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

This project uses:

Code quality packages

  • PestPHP: a testing framework for PHP;
  • PHPStan: a static code analysis tool for PHP;
  • PHP_CodeSniffer: detects violations of a defined set of coding standards (for example PSR2 and PSR12).

Discussion (0)