mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
docs: migrate workflow docs to separate folder
Files under `.github/workflows/` require the `workflow` PAT scope to modify. Once release-please's `extra-files` glob started rewriting these README files on release, the action failed with "Error adding to tree." Moving the docs to `docs/workflows/` lets the existing token update them without needing a wider scope.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# MageCheck Extension
|
||||
|
||||
A Github Workflow that runs various kinds of quality checks for a Magento Extension.
|
||||
|
||||
## Inputs
|
||||
|
||||
See the [check-extension.yaml](../../.github/workflows/check-extension.yaml)
|
||||
|
||||
| Input | Description | Required | Default |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------- |
|
||||
| matrix | JSON string of [version matrix for Magento](./#matrix-format) | true | NULL |
|
||||
| fail-fast | Same as Github's [fail-fast](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast) | false | true |
|
||||
| path | The folder of the Magento store or extension that you are testing | false | . |
|
||||
| magento_repository | Where to install Magento from | false | https://mirror.mage-os.org/ |
|
||||
| composer_cache_key | A key to version the composer cache. Can be incremented if you need to bust the cache. | false | \_mageos |
|
||||
|
||||
### Matrix Format
|
||||
|
||||
The Magento matrix format outlined by the [supported versions action.](https://github.com/graycoreio/github-actions-magento2/tree/main/supported-version/supported.json)
|
||||
|
||||
## Usage
|
||||
|
||||
```yml
|
||||
name: Unit Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
compute_matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.supported-version.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: graycoreio/github-actions-magento2/supported-version@v7 # x-release-please-major
|
||||
id: supported-version
|
||||
- run: echo ${{ steps.supported-version.outputs.matrix }}
|
||||
check-extension:
|
||||
needs: compute_matrix
|
||||
uses: graycoreio/github-actions-magento2/.github/workflows/check-extension.yaml@v7 # x-release-please-major
|
||||
with:
|
||||
matrix: ${{ needs.compute_matrix.outputs.matrix }}
|
||||
```
|
||||
@@ -0,0 +1,58 @@
|
||||
# MageCheck Store
|
||||
|
||||
A Github Workflow that runs various kinds of quality checks for a Magento Store.
|
||||
|
||||
Unlike [MageCheck Extension](./check-extension.md), this workflow automatically detects the Magento version from your store's `composer.lock` — no matrix computation required in the calling workflow.
|
||||
|
||||
## Inputs
|
||||
|
||||
See the [check-store.yaml](../../.github/workflows/check-store.yaml)
|
||||
|
||||
| Input | Description | Required | Default |
|
||||
| ------------------- | -------------------------------------------------------------------------------------- | -------- | --------- |
|
||||
| path | The folder of the Magento store that you are testing | false | . |
|
||||
| composer_cache_key | A key to version the composer cache. Can be incremented if you need to bust the cache. | false | \_mageos |
|
||||
| store_artifact_name | If provided, download store files from this artifact instead of using actions/checkout | false | "" |
|
||||
|
||||
## Secrets
|
||||
|
||||
| Input | Description | Required | Default |
|
||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
|
||||
| composer_auth | Your composer credentials (typically a stringified json object of the contents of your auth.json) | false | NULL |
|
||||
|
||||
## Checks Run
|
||||
|
||||
- **Unit Tests** — runs PHPUnit against custom code in `app/code`. Skipped automatically if no test files are found.
|
||||
- **Coding Standard** — runs the Magento Coding Standard against `app/code`. Uses your `phpcs.xml` (or `.phpcs.xml`, `phpcs.xml.dist`, `.phpcs.xml.dist`) if one exists, otherwise a sensible default is generated.
|
||||
|
||||
## Usage
|
||||
|
||||
```yml
|
||||
name: Check Store
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
check-store:
|
||||
uses: graycoreio/github-actions-magento2/.github/workflows/check-store.yaml@v7 # x-release-please-major
|
||||
secrets:
|
||||
composer_auth: ${{ secrets.COMPOSER_AUTH }}
|
||||
```
|
||||
|
||||
### Usage with a store artifact
|
||||
|
||||
If your pipeline builds or prepares the store in a prior job and uploads it as an artifact, you can pass the artifact name instead of relying on `actions/checkout`:
|
||||
|
||||
```yml
|
||||
jobs:
|
||||
check-store:
|
||||
uses: graycoreio/github-actions-magento2/.github/workflows/check-store.yaml@v7 # x-release-please-major
|
||||
secrets:
|
||||
composer_auth: ${{ secrets.COMPOSER_AUTH }}
|
||||
```
|
||||
@@ -0,0 +1,66 @@
|
||||
# Integration Tests for a Magento Package
|
||||
|
||||
> **Deprecated** — use [MageCheck Extension](./check-extension.md) instead. Scheduled for removal in v10.
|
||||
|
||||
A Github Workflow that runs the Integration Tests of a Magento Package
|
||||
|
||||
## Inputs
|
||||
|
||||
See the [integration.yaml](../../.github/workflows/integration.yaml)
|
||||
|
||||
| Input | Description | Required | Default |
|
||||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------- |
|
||||
| matrix | JSON string of [version matrix for Magento](./#matrix-format). Must include a `services` key (pass `include_services: true` to the supported-version action). | true | NULL |
|
||||
| fail-fast | Same as Github's [fail-fast](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast) | false | true |
|
||||
| package_name | The name of the package | true | NULL |
|
||||
| use_local_source | Whether or not you want to test your local package or not. | false | true |
|
||||
| source_folder | The source folder of the package | false | $GITHUB_WORKSPACE |
|
||||
| magento_directory | The folder where Magento will be installed | false | ../magento2 |
|
||||
| magento_repository | Where to install Magento from | false | https://mirror.mage-os.org/ |
|
||||
| test_command | The integration test command to run | false | "../../../vendor/bin/phpunit" |
|
||||
| composer_cache_key | A key to version the composer cache. Can be incremented if you need to bust the cache. | false | "" |
|
||||
|
||||
## Secrets
|
||||
| Input | Description | Required | Default |
|
||||
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
|
||||
| composer_auth | JSON string of [composer credentials](https://devdocs.magento.com/guides/v2.4/install-gde/prereq/connect-auth.html) | false | NULL |
|
||||
|
||||
### Matrix Format
|
||||
|
||||
The Magento matrix format outlined by the [supported versions action.](https://github.com/graycoreio/github-actions-magento2/tree/main/supported-version/supported.json)
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```yml
|
||||
name: Integration Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
compute_matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.supported-version.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: graycoreio/github-actions-magento2/supported-version@v7 # x-release-please-major
|
||||
with:
|
||||
include_services: true
|
||||
id: supported-version
|
||||
integration-workflow:
|
||||
needs: compute_matrix
|
||||
uses: graycoreio/github-actions-magento2/.github/workflows/integration.yaml@v7 # x-release-please-major
|
||||
with:
|
||||
package_name: my-vendor/package
|
||||
matrix: ${{ needs.compute_matrix.outputs.matrix }}
|
||||
test_command: ../../../vendor/bin/phpunit ../../../vendor/my-vendor/package/Test/Integration
|
||||
secrets:
|
||||
composer_auth: ${{ secrets.COMPOSER_AUTH }}
|
||||
```
|
||||
Reference in New Issue
Block a user