From 6b37510914723561b4b09ab837bdb11671e8f3f1 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sun, 26 Jan 2020 22:02:16 +0100 Subject: [PATCH] Add linting via github actions Signed-off-by: Roeland Jago Douma --- .github/workflows/lint.yml | 36 ++++++++++++++++++++++++++++++++++++ composer.json | 14 ++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 composer.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..3e50644f2 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: Lint +on: pull_request + +jobs: + php-linters: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['7.2', '7.3', 7.4] + name: php${{ matrix.php-versions }} lint + steps: + - name: Checkout + uses: actions/checkout@master + - name: Set up php${{ matrix.php-versions }} + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + coverage: none + - name: Lint + run: composer run lint + + node-linters: + runs-on: ubuntu-latest + name: ESLint + steps: + - uses: actions/checkout@master + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: npm install + run: npm ci + - name: eslint + run: npm run lint + env: + CI: true diff --git a/composer.json b/composer.json new file mode 100644 index 000000000..65209c07f --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "nextcloud/notifications", + "description": "notifications", + "license": "AGPL", + "config": { + "optimize-autoloader": true, + "classmap-authoritative": true + }, + "require": { + }, + "scripts": { + "lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;" + } +}