Download the PHP package devshop/yaml-tasks without Composer

On this page you can find all versions of the php package devshop/yaml-tasks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yaml-tasks

Yaml Tasks

Formerly Yaml Tests

Yaml Tasks is a simple composer plugin that make it as simple as possible to define and run a set of commands using YML.

It provides a composer command and an executable script that simply reads a YML file and runs each line as a process.

In addition, it integrates with GitHub's Commit Status API. If GITHUB_TOKEN is specified, the status of each command will be posted back to GitHub.com, to be displayed on the pull request.

The output is rendered in a way to be easier to read, and proper exit code returns if a single process fails.

Get Started

  1. Add YamlTasks to your project.

    cd my-composer-project
    composer require devshop/yaml-tasks
  2. Create a tests.yml file that looks something like this:

    myproject/php/lint: find src -name '*.php' -print0 | xargs -0 -n1 php -l
    myproject/php/cs: 
      description: CodeSniffer
      command: bin/phpcs --standard=PSR2 -n  --colors
    myproject/debug/environment: |
      env
  3. Run the yaml-tasks composer command or the yaml-tasks bin script:

    composer yaml-tasks
    bin/yaml-tasks

    or

    composer y

Global Install

To confirm the command is installed, ask for help:

Or run the bin/yaml-tasks command:

GitHub Integration

If you pass yaml-tasks a GitHub Token, it will send the test results as "commit status" indicators.

There are 3 ways to pass the GitHub Token to YamlTasks:

  1. Use the --github-token command line option. Don't use this in CI, or you might expose your GitHub token in logs.
  2. Set a GITHUB_TOKEN environment variable. This is pretty simple in Docker, but can be a challenge if your tasks get run in different environments.
  3. Recommended: Create a .env file in your repo, or in your user's home directory:

    There is a .env.example file in this directory you can use as an example.

Writing tasks

Create tasks.yml file

By default the composer yaml-tasks command looks for a tasks.yml file in the project root. You can also pass a path using the --tasks-file option.

The tasks.yml file is read as a simple collection of commands. The key can be any string, as long as it is unique in the test suite.

You can also include commands in a list:

You can include a description for each test like:

Commands in tasks.yml

Yaml Tasks work like Composer Scripts: If your project has the config.bin-dir set in composer.json, Composer will automatically add that directory to the PATH when scripts or other commands are run.

For example, you can include PHPUnit and call it without specifying the full path in composer scripts or tasks.yml

composer.json:

Having the scripts.test section in composer.json creates a composer command called composer test.

tasks.yml:

If you want to only maintain one set of scripts, you can reference composer scripts in tasks.yml:

tasks.yml:

Running tasks

Once the tasks.yml file is in place, and the composer yaml-tasks command is available, you can trigger test runs.

Dry Runs vs Normal

This plugin was also designed to pass these tasks as "Commit Statuses" on GitHub. This allows us to tag the results to the specific commit, pass or fail.

If the environment variable GITHUB_TOKEN or the command line option --github-token is NOT set, the --dry-run option will be forced.

Use the --dry-run option if you have a token set but do not want to post test results to GitHub.

Run composer yaml-tasks or, just like all composer commands, you can use shortcuts like compose y.

The output will look something like this:

Test Run

And you will get a nice summary at the end like this:

Test Run

Yaml-Tasks executable

There is now a "bin" for yaml-tasks, allowing the command to be run by itself.

If you require devshop/yaml-tasks, you will see a symlink to yaml-tasks in your bin-dir.


All versions of yaml-tasks with dependencies

PHP Build Version
Package Version
Requires ext-json Version *
composer-plugin-api Version ^1.0 || ^2.0
consolidation/robo Version ^2
devshop/power-process Version @dev
guzzlehttp/guzzle Version ^6
guzzlehttp/psr7 Version ^1.9
http-interop/http-factory-guzzle Version ^1.2
knplabs/github-api Version ^3.9||^1.0
php-http/guzzle6-adapter Version 2.x-dev
teqneers/php-stream-wrapper-for-git Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package devshop/yaml-tasks contains the following files

Loading the files please wait ....