Skip to content

Commit 11d8aad

Browse files
Shikha MishraShikha Mishra
authored andcommitted
Added github action
0 parents  commit 11d8aad

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Container image that runs your code
2+
FROM php:7.3-cli-alpine3.9
3+
4+
COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer
5+
6+
RUN /usr/local/bin/composer global require magento/magento-coding-standard:*
7+
RUN ~/.composer/vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/
8+
RUN echo memory_limit = -1 >> /usr/local/etc/php/conf.d/custom-memory.ini
9+
# Copies your code file from your action repository to the filesystem path `/` of the container
10+
COPY entrypoint.sh /entrypoint.sh
11+
12+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
13+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Coding Standard for Magento 2 docker action
2+
3+
This action checks coding standard of magento 2 extensions.
4+
5+
## Inputs
6+
7+
## `error-severity`
8+
9+
The severity of error to check. Default `"10"`.
10+
11+
## Outputs
12+
13+
## `errors`
14+
15+
The test result
16+
17+
## Example usage
18+
19+
uses: actions/magento2-docker-action@v1
20+
with:
21+
error-severity: '10'

action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# action.yml
2+
name: 'Coding Standard for Magento 2'
3+
description: 'Github Action for magento 2'
4+
inputs:
5+
error-severity: # id of input
6+
description: 'Error severity'
7+
required: false
8+
default: '10'
9+
outputs:
10+
time: # id of output
11+
description: 'The test result'
12+
runs:
13+
using: 'docker'
14+
image: 'Dockerfile'
15+
args:
16+
- ${{ inputs.error-severity }}

entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh -l
2+
3+
cd $GITHUB_WORKSPACE
4+
sh -c "/root/.composer/vendor/bin/phpcs --standard=Magento2 --error-severity=10 --warning-severity=8 $GITHUB_WORKSPACE -s $*"

0 commit comments

Comments
 (0)