Skip to content

Commit 960d1e2

Browse files
committed
ci: Move linters to standard actions
Signed-off-by: Julius Knorr <[email protected]>
1 parent 900986f commit 960d1e2

File tree

4 files changed

+185
-87
lines changed

4 files changed

+185
-87
lines changed

.github/workflows/lint-eslint.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint eslint
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-eslint-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
changes:
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src}}
29+
30+
steps:
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- 'tsconfig.json'
43+
- '.eslintrc.*'
44+
- '.eslintignore'
45+
- '**.js'
46+
- '**.ts'
47+
- '**.vue'
48+
49+
lint:
50+
runs-on: ubuntu-latest
51+
52+
needs: changes
53+
if: needs.changes.outputs.src != 'false'
54+
55+
name: NPM lint
56+
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
60+
61+
- name: Read package.json node and npm engines version
62+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
63+
id: versions
64+
with:
65+
fallbackNode: '^20'
66+
fallbackNpm: '^10'
67+
68+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
69+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
70+
with:
71+
node-version: ${{ steps.versions.outputs.nodeVersion }}
72+
73+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
74+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
75+
76+
- name: Install dependencies
77+
env:
78+
CYPRESS_INSTALL_BINARY: 0
79+
PUPPETEER_SKIP_DOWNLOAD: true
80+
run: npm ci
81+
82+
- name: Lint
83+
run: npm run lint
84+
85+
summary:
86+
permissions:
87+
contents: none
88+
runs-on: ubuntu-latest-low
89+
needs: [changes, lint]
90+
91+
if: always()
92+
93+
# This is the summary, we just avoid to rename it so that branch protection rules still match
94+
name: eslint
95+
96+
steps:
97+
- name: Summary status
98+
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/lint-info-xml.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint info.xml
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-info-xml-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
xml-linters:
22+
runs-on: ubuntu-latest-low
23+
24+
name: info.xml lint
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
28+
29+
- name: Download schema
30+
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
31+
32+
- name: Lint info.xml
33+
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
34+
with:
35+
xml-file: ./appinfo/info.xml
36+
xml-schema-file: ./info.xsd

.github/workflows/lint-stylelint.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint stylelint
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-stylelint-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
24+
name: stylelint
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
29+
30+
- name: Read package.json node and npm engines version
31+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
32+
id: versions
33+
with:
34+
fallbackNode: '^20'
35+
fallbackNpm: '^10'
36+
37+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
38+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
39+
with:
40+
node-version: ${{ steps.versions.outputs.nodeVersion }}
41+
42+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
43+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
44+
45+
- name: Install dependencies
46+
env:
47+
CYPRESS_INSTALL_BINARY: 0
48+
run: npm ci
49+
50+
- name: Lint
51+
run: npm run stylelint

.github/workflows/lint.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)