Skip to content

Commit

Permalink
Added github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Shikha Mishra authored and Shikha Mishra committed Jul 3, 2021
0 parents commit 11d8aad
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Container image that runs your code
FROM php:7.3-cli-alpine3.9

COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer

RUN /usr/local/bin/composer global require magento/magento-coding-standard:*
RUN ~/.composer/vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/
RUN echo memory_limit = -1 >> /usr/local/etc/php/conf.d/custom-memory.ini
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Coding Standard for Magento 2 docker action

This action checks coding standard of magento 2 extensions.

## Inputs

## `error-severity`

The severity of error to check. Default `"10"`.

## Outputs

## `errors`

The test result

## Example usage

uses: actions/magento2-docker-action@v1
with:
error-severity: '10'
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# action.yml
name: 'Coding Standard for Magento 2'
description: 'Github Action for magento 2'
inputs:
error-severity: # id of input
description: 'Error severity'
required: false
default: '10'
outputs:
time: # id of output
description: 'The test result'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.error-severity }}
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh -l

cd $GITHUB_WORKSPACE
sh -c "/root/.composer/vendor/bin/phpcs --standard=Magento2 --error-severity=10 --warning-severity=8 $GITHUB_WORKSPACE -s $*"

0 comments on commit 11d8aad

Please sign in to comment.