Skip to content

Commit

Permalink
Merge pull request #2 from Nosto/ADS-4214_add_linting_workflow
Browse files Browse the repository at this point in the history
ADS-4214 Add linting workflow
  • Loading branch information
TobiasGraml11 authored Oct 17, 2023
2 parents f5a0da8 + 6fe351d commit 23a49b3
Show file tree
Hide file tree
Showing 54 changed files with 13,161 additions and 355 deletions.
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

0 comments on commit 23a49b3

Please sign in to comment.