mirror of https://github.com/nextcloud/bookmarks
Update github actions and add php-cs
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
6fad8b5d3a
commit
03eda33eda
|
@ -28,24 +28,70 @@ jobs:
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: composer run lint
|
run: composer run lint
|
||||||
|
|
||||||
|
php-cs-fixer:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.4']
|
||||||
|
|
||||||
|
name: cs php${{ matrix.php-versions }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up php
|
||||||
|
uses: shivammathur/setup-php@master
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
coverage: none
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer i
|
||||||
|
|
||||||
|
- name: Run coding standards check
|
||||||
|
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
|
||||||
|
|
||||||
node:
|
node:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-versions: [12.x]
|
node-version: [12.x]
|
||||||
|
|
||||||
name: node${{ matrix.node-versions }}
|
name: eslint node${{ matrix.node-version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up node ${{ matrix.node-versions }}
|
- name: Set up node ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-versions: ${{ matrix.node-versions }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
|
stylelint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [12.x]
|
||||||
|
|
||||||
|
name: stylelint node${{ matrix.node-version }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up node ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run stylelint
|
||||||
|
|
|
@ -13,18 +13,22 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-versions: [12.x]
|
node-version: [12.x]
|
||||||
|
|
||||||
name: node${{ matrix.node-versions }}
|
name: node${{ matrix.node-version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up node ${{ matrix.node-versions }}
|
- name: Set up node ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-versions: ${{ matrix.node-versions }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install dependencies & build
|
- name: Install dependencies & build
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
npm run build --if-present
|
npm run build --if-present
|
||||||
|
|
||||||
|
- name: Check webpack build changes
|
||||||
|
run: |
|
||||||
|
bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )"
|
||||||
|
|
|
@ -4,3 +4,4 @@ build
|
||||||
_build
|
_build
|
||||||
node_modules
|
node_modules
|
||||||
vendor
|
vendor
|
||||||
|
/.php_cs.cache
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
require_once './vendor/autoload.php';
|
||||||
|
|
||||||
|
use Nextcloud\CodingStandard\Config;
|
||||||
|
|
||||||
|
$config = new Config();
|
||||||
|
$config
|
||||||
|
->getFinder()
|
||||||
|
->notPath('build')
|
||||||
|
->notPath('l10n')
|
||||||
|
->notPath('src')
|
||||||
|
->notPath('vendor')
|
||||||
|
->in(__DIR__);
|
||||||
|
return $config;
|
|
@ -14,13 +14,16 @@
|
||||||
"rowbot/url": "^3.0"
|
"rowbot/url": "^3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^8.5"
|
"phpunit/phpunit": "^8.5",
|
||||||
|
"nextcloud/coding-standard": "^0.3.0"
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"optimize-autoloader": true,
|
"optimize-autoloader": true,
|
||||||
"classmap-authoritative": true
|
"classmap-authoritative": true
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
|
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
|
||||||
|
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||||
|
"cs:fix": "php-cs-fixer fix"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue