nextcloud-notes/.github/workflows/lint.yml

70 lines
1.8 KiB
YAML

name: Lint
on:
push:
branches:
- master
- stable*
pull_request:
jobs:
lint-js:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v1
- name: Set up Stylelint Problem Matcher
uses: xt0rted/stylelint-problem-matcher@v1
- name: Install Dependencies
run: npm ci
- name: lint JavaScript
run: make lint-js
- name: lint Stylesheets
run: make lint-css
- name: build JavaScript
run: make build-js-production
env:
CI: true
lint-xml:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup xmllint
run: |
sudo apt update
sudo apt install --no-install-recommends -y libxml2-utils
- name: Setup xmllint problem matcher
uses: korelstar/xmllint-problem-matcher@master
- name: lint XML
run: make lint-xml
lint-php:
runs-on: ubuntu-latest
strategy:
matrix:
version: [min, max]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Determine PHP version
env:
VERSION_MINMAX: ${{ matrix.version }}
run: echo "::set-env name=PHP_VERSION::$(php tests/nextcloud-version.php --php-$VERSION_MINMAX)"
- name: Set up PHP ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
- name: Install Dependencies
run: composer install --prefer-dist
- name: Install latest Nextcloud API (dev-master)
if: matrix.version == 'max'
run: composer require --dev christophwurst/nextcloud:dev-master
- name: Load problem matcher for php -l
uses: korelstar/phplint-problem-matcher@master
- name: lint PHP
run: make -k lint-php