mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat(setup-di-compile): restore setup-di-compile as a lean action (#239)
This commit is contained in:
@@ -34,3 +34,4 @@ Opinionated Github Actions and Workflows to make building, testing, and maintain
|
|||||||
| [Semver Compare](./semver-compare/README.md) | A Github Action that semantically compares two versions |
|
| [Semver Compare](./semver-compare/README.md) | A Github Action that semantically compares two versions |
|
||||||
| [Supported Version](./supported-version/README.md) | A Github Action that computes the currently supported Github Actions Matrix for Magento 2 |
|
| [Supported Version](./supported-version/README.md) | A Github Action that computes the currently supported Github Actions Matrix for Magento 2 |
|
||||||
| [Setup Install](./setup-install/README.md) | A Github Action that runs `bin/magento setup:install` from the supported-version services matrix |
|
| [Setup Install](./setup-install/README.md) | A Github Action that runs `bin/magento setup:install` from the supported-version services matrix |
|
||||||
|
| [Setup DI Compile](./setup-di-compile/README.md) | A Github Action that enables all modules and runs `bin/magento setup:di:compile` |
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Setup DI Compile
|
||||||
|
|
||||||
|
A GitHub Action that enables all Magento modules and runs `bin/magento setup:di:compile`.
|
||||||
|
|
||||||
|
The caller is responsible for checkout, PHP/composer setup, and `composer install`. This action only performs the compilation step.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
| Input | Required | Default | Description |
|
||||||
|
| ------ | -------- | ------- | ------------------------------------------------------------------ |
|
||||||
|
| `path` | No | `.` | Path to the Magento root directory. |
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```yml
|
||||||
|
name: DI Compile
|
||||||
|
|
||||||
|
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@main
|
||||||
|
id: supported-version
|
||||||
|
|
||||||
|
compile:
|
||||||
|
needs: compute_matrix
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: ${{ fromJSON(needs.compute_matrix.outputs.matrix) }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- uses: graycoreio/github-actions-magento2/setup-magento@main
|
||||||
|
id: setup-magento
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php }}
|
||||||
|
tools: composer:v${{ matrix.composer }}
|
||||||
|
|
||||||
|
- uses: graycoreio/github-actions-magento2/cache-magento@main
|
||||||
|
|
||||||
|
- run: composer install
|
||||||
|
env:
|
||||||
|
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
|
||||||
|
|
||||||
|
- uses: graycoreio/github-actions-magento2/setup-di-compile@main
|
||||||
|
with:
|
||||||
|
path: ${{ steps.setup-magento.outputs.path }}
|
||||||
|
```
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
name: "Magento compilation (setup:di:compile)"
|
||||||
|
author: "Graycore"
|
||||||
|
description: "A GitHub Action that runs bin/magento setup:di:compile."
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
required: false
|
||||||
|
default: "."
|
||||||
|
description: "Path to the Magento root directory. Accepts the output of the setup-magento action."
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Enable all modules
|
||||||
|
working-directory: ${{ inputs.path }}
|
||||||
|
shell: bash
|
||||||
|
run: php bin/magento module:enable --all
|
||||||
|
|
||||||
|
- name: Compile
|
||||||
|
working-directory: ${{ inputs.path }}
|
||||||
|
shell: bash
|
||||||
|
run: php bin/magento setup:di:compile
|
||||||
|
|
||||||
|
branding:
|
||||||
|
icon: "tool"
|
||||||
|
color: "orange"
|
||||||
Reference in New Issue
Block a user