50 lines
1.8 KiB
Markdown
50 lines
1.8 KiB
Markdown
# Pest Workflow
|
|
|
|
This workflow automates running tests using the Pest framework for PHP. It runs inside a Docker container for consistent test execution across different environments.
|
|
|
|
## Usage Example
|
|
|
|
In this example, the `pest` workflow uses Pest to run the tests within the application. You can override the Docker image if needed.
|
|
|
|
```yaml
|
|
jobs:
|
|
pest:
|
|
uses: your-repo/.github/workflows/pest.yml@main
|
|
```
|
|
|
|
### Input Parameters
|
|
|
|
- **image** (optional):
|
|
- **Type:** `string`
|
|
- **Default:** `git.qlic.nl/qlic/quality:latest`
|
|
- **Description:** Docker image used for the testing process. If not provided, it defaults to the latest version of the quality check image from the QLIC registry.
|
|
|
|
- **username** (optional):
|
|
- **Type:** `string`
|
|
- **Default:** `${{ vars.REGISTRY_USERNAME }}`
|
|
- **Description:** Username for Docker registry authentication. If not provided, the default value stored in `REGISTRY_USERNAME` is used.
|
|
|
|
- **password** (optional):
|
|
- **Type:** `string`
|
|
- **Default:** `${{ vars.REGISTRY_PASSWORD }}`
|
|
- **Description:** Password for Docker registry authentication. If not provided, the default value stored in `REGISTRY_PASSWORD` is used.
|
|
|
|
## Workflow Job: `pest`
|
|
|
|
The `pest` job runs tests using the Pest PHP testing framework.
|
|
|
|
### Steps
|
|
|
|
1. **Setup Composer:**
|
|
- **Action:**
|
|
Uses (`https://git.qlic.nl/actions/setup-composer@main`) to install necessary PHP dependencies, including Pest.
|
|
- **Description:** Installs the dependencies defined in `composer.json`, setting up the environment to run Pest tests.
|
|
|
|
2. **Run Pest:**
|
|
- **Run Command:**
|
|
```bash
|
|
./vendor/bin/pest
|
|
```
|
|
- **Description:** Executes the Pest test runner to run all defined tests in the project. Pest is a testing framework for PHP, known for its simplicity and expressive syntax.
|
|
|