2020-02-02 08:04:37 +01:00
|
|
|
name: Lint
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-03-29 14:43:51 +02:00
|
|
|
- stable*
|
2020-02-02 08:04:37 +01:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint-js:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-03-29 14:43:51 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-02-02 08:04:37 +01:00
|
|
|
- name: Set up Node
|
2020-12-28 12:43:52 +01:00
|
|
|
uses: actions/setup-node@v2
|
2020-02-02 08:04:37 +01:00
|
|
|
- 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
|
2020-03-29 14:43:51 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-02-02 08:04:37 +01:00
|
|
|
- name: Setup xmllint
|
2020-02-23 22:01:59 +01:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install --no-install-recommends -y libxml2-utils
|
2020-02-13 12:44:56 +01:00
|
|
|
- name: Setup xmllint problem matcher
|
|
|
|
uses: korelstar/xmllint-problem-matcher@master
|
2020-02-02 08:04:37 +01:00
|
|
|
- name: lint XML
|
|
|
|
run: make lint-xml
|
|
|
|
|
|
|
|
lint-php:
|
|
|
|
runs-on: ubuntu-latest
|
2020-02-13 15:22:52 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
version: [min, max]
|
2020-07-13 22:22:26 +02:00
|
|
|
fail-fast: false
|
2021-03-01 14:35:46 +01:00
|
|
|
env:
|
|
|
|
NC_API_TAG: 'dev-master'
|
2020-02-02 08:04:37 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2020-03-29 14:43:51 +02:00
|
|
|
uses: actions/checkout@v2
|
2020-06-19 15:01:42 +02:00
|
|
|
- name: Determine PHP version
|
|
|
|
env:
|
|
|
|
VERSION_MINMAX: ${{ matrix.version }}
|
2020-11-22 13:47:18 +01:00
|
|
|
run: echo "PHP_VERSION=$(php tests/nextcloud-version.php --php-$VERSION_MINMAX)" >> $GITHUB_ENV
|
2020-06-19 15:01:42 +02:00
|
|
|
- name: Set up PHP ${{ env.PHP_VERSION }}
|
2020-03-29 14:43:51 +02:00
|
|
|
uses: shivammathur/setup-php@v2
|
2020-02-13 15:22:52 +01:00
|
|
|
with:
|
2020-06-19 15:01:42 +02:00
|
|
|
php-version: ${{ env.PHP_VERSION }}
|
2021-03-01 14:35:46 +01:00
|
|
|
- name: Determine minimum Nextcloud API version
|
|
|
|
if: matrix.version == 'min'
|
|
|
|
run: echo "NC_API_TAG=$(php tests/nextcloud-version.php --appinfo)" >> $GITHUB_ENV
|
2020-02-02 08:04:37 +01:00
|
|
|
- name: Install Dependencies
|
2021-03-01 14:35:46 +01:00
|
|
|
run: |
|
|
|
|
composer require --dev christophwurst/nextcloud:$NC_API_TAG
|
|
|
|
composer install --prefer-dist
|
2020-02-13 16:39:05 +01:00
|
|
|
- name: Load problem matcher for php -l
|
|
|
|
uses: korelstar/phplint-problem-matcher@master
|
2020-02-02 08:04:37 +01:00
|
|
|
- name: lint PHP
|
2020-02-13 16:39:05 +01:00
|
|
|
run: make -k lint-php
|
2020-03-29 14:43:51 +02:00
|
|
|
|