add readme

This commit is contained in:
Jamie Schouten 2024-09-14 20:14:31 +02:00
parent f923c7d1da
commit b7140972a3
2 changed files with 51 additions and 6 deletions

View File

@ -1,12 +1,8 @@
name: build
name: pest
on:
workflow_call:
inputs:
tag:
required: false
type: string
default: latest
image:
required: false
type: string
@ -21,7 +17,7 @@ on:
default: ${{ vars.REGISTRY_PASSWORD }}
jobs:
test:
pest:
runs-on: ubuntu-24.04
container:
image: ${{ inputs.image }}

49
README.md Normal file
View File

@ -0,0 +1,49 @@
# 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.