diff --git a/.gitea/workflows/pest.yml b/.gitea/workflows/pest.yml index d4e36c1..e589f69 100644 --- a/.gitea/workflows/pest.yml +++ b/.gitea/workflows/pest.yml @@ -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 }} diff --git a/README.md b/README.md new file mode 100644 index 0000000..b2e66e1 --- /dev/null +++ b/README.md @@ -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. +