diff --git a/.github/workflows/dependabot-approve.yml b/.github/workflows/dependabot-approve.yml new file mode 100644 index 0000000..cc5e6d1 --- /dev/null +++ b/.github/workflows/dependabot-approve.yml @@ -0,0 +1,11 @@ +name: Dependabot auto approve +on: pull_request + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: hmarr/auto-approve-action@v2.0.0 + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..3e50644 --- /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/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..df207ce --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,32 @@ +name: Node CI + +on: + pull_request: + branches: + - master + - stable* + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: npm install, build + run: | + npm ci + npm run build --if-present + - name: check webpack build + run: | + bash -c "[[ ! \"`git status --porcelain `\" ]] || ( echo 'Uncommited changes in webpack build' && git status && exit 1 )" + env: + CI: true diff --git a/composer.json b/composer.json index 214fc84..45c5f76 100644 --- a/composer.json +++ b/composer.json @@ -16,5 +16,8 @@ "require-dev": { "christophwurst/nextcloud": "^16.0", "phpunit/phpunit": "^7." + }, + "scripts": { + "lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;" } }