From 348538fe6c311385cbee006b9e15c8d79999ec7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 5 Feb 2020 20:25:17 +0100 Subject: [PATCH 1/3] Add dedicated lint action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .github/workflows/lint.yml | 45 ++++++++++++++++++++++++++++++++++++ .github/workflows/nodejs.yml | 5 ---- 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..9a6d7b1b3 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,45 @@ +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + php: + runs-on: ubuntu-latest + + strategy: + matrix: + php-versions: ['7.2', '7.3', '7.4'] + + name: php${{ matrix.php-versions }} lint + steps: + - uses: actions/checkout@v2 + - name: Set up php${{ matrix.php-versions }} + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + - name: Lint + run: composer run lint + + node: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v2 + - name: Use node ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm ci + - name: ESLint + run: npm run lint diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 76dbe8c8a..a48182b2b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -23,9 +23,4 @@ jobs: - name: build run: | npm run build --if-present - - name: eslint - run: | - npm run lint - env: - CI: true From 5e6cc83de0c1dee13298b1a9d7b9767b799ce97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 5 Feb 2020 20:26:33 +0100 Subject: [PATCH 2/3] Remove node build from drone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .drone.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5139bb537..6ac3a5a55 100644 --- a/.drone.yml +++ b/.drone.yml @@ -130,28 +130,3 @@ trigger: event: - pull_request - push - ---- -kind: pipeline -name: frontend -steps: - - name: install - image: node:lts-alpine - commands: - - npm install - - name: eslint - image: node:lts-alpine - commands: - - npm run lint - - name: jsbuild - image: node:lts-alpine - commands: - - npm run build -trigger: - branch: - - master - - stable* - - vue - event: - - pull_request - - push From 5b0c0f8195a979bde840f4b839c789075d3eeb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 5 Feb 2020 20:28:35 +0100 Subject: [PATCH 3/3] Add lint script to composer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- composer.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composer.json b/composer.json index 52017f826..9a6aced1f 100644 --- a/composer.json +++ b/composer.json @@ -16,5 +16,12 @@ "christophwurst/nextcloud": "^17", "jakub-onderka/php-parallel-lint": "^1.0.0", "phpunit/phpunit": "^8" + }, + "config": { + "optimize-autoloader": true, + "classmap-authoritative": true + }, + "scripts": { + "lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;" } }