Skip to content

Add GitHub action to check theme build commands #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/magento-theme-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Magento Theme Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

Check warning on line 21 in .github/workflows/magento-theme-build.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/magento-theme-build.yml#L21

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.

- name: Environment setup
run: |
brew install bats-core mkcert
mkcert -install

- name: Install ddev
run: brew install ddev/ddev/ddev

- name: Set up ddev
run: |
ddev config --project-type=magento2 --docroot=pub --create-docroot
ddev start

- name: Install Magento
run: |
ddev exec composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.4.3-p1 .
ddev exec bin/magento setup:install --base-url=http://magento2.ddev.site --db-host=db --db-name=db --db-user=db --db-password=db --admin-firstname=admin --admin-lastname=admin [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

- name: Run theme build commands
run: |
ddev exec bin/magento setup:upgrade
ddev exec bin/magento setup:di:compile
ddev exec bin/magento setup:static-content:deploy -f
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,18 @@
## License

[License](./LICENSE) | by [Mathias Elle](https://www.linkedin.com/in/mathias-elle-842783102/)

## GitHub Action for Checking Theme Build Commands

We have added a new GitHub action to set up a Magento demo store and check theme build commands. This action runs on `push` and `pull_request` events.

Check notice on line 184 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L184

Expected: 80; Actual: 150

### Usage

Check notice on line 186 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L186

Multiple headings with the same content

To use the new GitHub action, follow these steps:

1. Ensure that the `.github/workflows/magento-theme-build.yml` file is present in your repository.

Check notice on line 190 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L190

Expected: 80; Actual: 98
2. The action will automatically run on `push` and `pull_request` events.

The action includes steps to set up ddev, install Magento, and run theme build commands.

For more details, refer to the `.github/workflows/magento-theme-build.yml` file in your repository.

Check notice on line 195 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L195

Expected: 80; Actual: 99
Loading