mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat: make cache key consistent (and configurable) (#38)
This commit is contained in:
@@ -6,20 +6,21 @@ A Github Workflow that runs the Integration Tests of a Magento Package
|
||||
|
||||
See the [integration.yaml](./integration.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 |
|
||||
| package_name | The name of the package | true | NULL |
|
||||
| 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" |
|
||||
| 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 |
|
||||
| package_name | The name of the package | true | NULL |
|
||||
| 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]([#./matrix-format](https://devdocs.magento.com/guides/v2.4/install-gde/prereq/connect-auth.html)) | false | NULL |
|
||||
| composer_auth | JSON string of [composer credentials]([#./matrix-format](https://devdocs.magento.com/guides/v2.4/install-gde/prereq/connect-auth.html)) | false | NULL |
|
||||
|
||||
### Matrix Format
|
||||
|
||||
|
||||
@@ -41,6 +41,12 @@ on:
|
||||
default: ../../../vendor/bin/phpunit
|
||||
description: "The integration test command to run"
|
||||
|
||||
composer_cache_key:
|
||||
type: string
|
||||
required: false
|
||||
default: ''
|
||||
description: A key to version the composer cache. Can be incremented if you need to bust the cache.
|
||||
|
||||
secrets:
|
||||
composer_auth:
|
||||
required: false
|
||||
@@ -117,7 +123,7 @@ jobs:
|
||||
- name: "Cache Composer Packages"
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: 'composer | v3 | "$(Agent.OS)" | composer.lock | ${{ matrix.composer }} | ${{ matrix.php }} | ${{ matrix.magento }}'
|
||||
key: "composer | v4 | ${{ inputs.composer_cache_key }} | ${{ hashFiles('composer.lock') }} | ${{ matrix.os }} | ${{ matrix.composer }} | ${{ matrix.php }} | ${{ matrix.magento }}"
|
||||
path: ${{ steps.composer-cache.outputs.dir }}
|
||||
|
||||
- run: composer config repositories.local path ${{ inputs.source_folder }}
|
||||
|
||||
Reference in New Issue
Block a user