diff options
author | Joas Schilling <coding@schilljs.com> | 2022-01-21 16:00:11 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-01-21 16:00:11 +0100 |
commit | edb00a896b991581250d5faec440bea6fb6e51a6 (patch) | |
tree | 8d3faa97f832316e2e02baecb5c9e0989d130ee2 /.github | |
parent | 764805f01787a19a5f19ac0f6c227f40fe449b68 (diff) |
Move to unified linting
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/lint-eslint.yml | 44 | ||||
-rw-r--r-- | .github/workflows/lint-info-xml.yml | 31 | ||||
-rw-r--r-- | .github/workflows/lint-php-cs.yml | 35 | ||||
-rw-r--r-- | .github/workflows/lint-php.yml | 47 | ||||
-rw-r--r-- | .github/workflows/lint-stylelint.yml | 44 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 108 |
6 files changed, 201 insertions, 108 deletions
diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml new file mode 100644 index 000000000..11590ffb0 --- /dev/null +++ b/.github/workflows/lint-eslint.yml @@ -0,0 +1,44 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: eslint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.1 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v2 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml new file mode 100644 index 000000000..cea2a2bc7 --- /dev/null +++ b/.github/workflows/lint-info-xml.yml @@ -0,0 +1,31 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + xml-linters: + runs-on: ubuntu-latest + + name: info.xml lint + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Download schema + run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd + + - name: Lint info.xml + uses: ChristophWurst/xmllint-action@v1 + with: + xml-file: ./appinfo/info.xml + xml-schema-file: ./info.xsd diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml new file mode 100644 index 000000000..9aad51409 --- /dev/null +++ b/.github/workflows/lint-php-cs.yml @@ -0,0 +1,35 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: php-cs + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: "7.4" + coverage: none + + - name: Install dependencies + run: composer i + + - name: Lint + run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 000000000..45493c345 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,47 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + php-lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["7.3", "7.4", "8.0"] + + name: php-lint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + + - name: Lint + run: composer run lint + + summary: + runs-on: ubuntu-latest + needs: php-lint + + if: always() + + name: php-lint-summary + + steps: + - name: Summary status + run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml new file mode 100644 index 000000000..64edcfba5 --- /dev/null +++ b/.github/workflows/lint-stylelint.yml @@ -0,0 +1,44 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +name: Lint + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + lint: + runs-on: ubuntu-latest + + name: stylelint + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@v1.1 + id: versions + with: + fallbackNode: '^12' + fallbackNpm: '^6' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@v2 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run stylelint diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 7d7217c8b..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,108 +0,0 @@ -name: Lint - -on: - pull_request: - push: - branches: - - master - - stable* - -jobs: - php: - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ['7.3', '7.4', '8.0'] - - name: php${{ matrix.php-versions }} - steps: - - uses: actions/checkout@v2 - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - - - name: Lint - run: composer run lint || ( echo 'Please run `composer run lint` and fix your code' && exit 1 ) - - 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@v2 - 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: - runs-on: ubuntu-latest - - name: eslint node - steps: - - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v2 - with: - node-version: 14 - - - name: Set up npm7 - run: npm i -g npm@7 - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint - - stylelint: - runs-on: ubuntu-latest - - name: stylelint node - steps: - - uses: actions/checkout@v2 - - - name: Set up node - uses: actions/setup-node@v2 - with: - node-version: 14 - - - name: Set up npm7 - run: npm i -g npm@7 - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run stylelint - - xml-linters: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@master - - name: Download schema - run: wget https://apps.nextcloud.com/schema/apps/info.xsd - - name: Lint info.xml - uses: ChristophWurst/xmllint-action@v1 - with: - xml-file: ./appinfo/info.xml - xml-schema-file: ./info.xsd |