Skip to content
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

ADS-4214 Add linting workflow #2

Merged
merged 7 commits into from
Oct 17, 2023
Merged
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/Resources/app/storefront/dist/*
8 changes: 8 additions & 0 deletions .eslintrc-administration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [
'./vendor/shopware/administration/Resources/app/administration/.eslintrc.js',
],
parserOptions: {
requireConfigFile: false,
},
};
44 changes: 44 additions & 0 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Lint JS

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

jobs:
build:
runs-on: ubuntu-latest

name: ESLint
steps:
- uses: actions/checkout@v2
with:
path: shopware6-job-scheduler

- name: Setup PHP with Composer 2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: dom, gd, mbstring, pdo_mysql, zip
coverage: xdebug
tools: composer:v2

- name: Validate dependencies
working-directory: shopware6-job-scheduler
run: composer validate

- name: Install plugin dependencies
working-directory: shopware6-job-scheduler
run: |
npm ci
composer install --no-interaction

- name: Install Shopware dependencies
working-directory: shopware6-job-scheduler
run: npm run install-sw-dependencies

- name: Run ESLint
working-directory: shopware6-job-scheduler
run: npm run administration-lint
38 changes: 38 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Lint PHP

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

jobs:
build:
runs-on: ubuntu-latest

name: PHPLint
steps:
- uses: actions/checkout@v2
with:
path: shopware6-job-scheduler

- name: Setup PHP with Composer 2
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: dom, gd, mbstring, pdo_mysql, zip
coverage: xdebug
tools: composer:v2

- name: Validate dependencies
working-directory: shopware6-job-scheduler
run: composer validate

- name: Install plugin dependencies
working-directory: shopware6-job-scheduler
run: composer install --no-interaction

- name: Run PHPLint
working-directory: shopware6-job-scheduler
run: composer run lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.idea
vendor
node_modules
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,21 @@
},
"require": {
"php": "^8.1"
},
"require-dev": {
"shopware/administration": "^6.5",
"symplify/easy-coding-standard": "^12.0"
},
"config": {
"platform": {
"php": "8.1"
},
"allow-plugins": {
"symfony/runtime": true
}
},
"scripts": {
"lint": "./vendor/bin/ecs check",
"fix": "./vendor/bin/ecs check --fix"
}
}
Loading
Loading