Skip to content

Commit 6621589

Browse files
committed
Merge PR #2: CI/CD and Vue 3 migration (preserve v1.3.x features)
2 parents 1af8ce5 + f14959f commit 6621589

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4728
-2123
lines changed

.eslintrc.cjs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
16
module.exports = {
2-
extends: [
3-
'@nextcloud',
4-
],
57
globals: {
6-
__webpack_nonce__: 'writable',
7-
__webpack_public_path__: 'writable',
8+
appVersion: true
9+
},
10+
parserOptions: {
11+
requireConfigFile: false
812
},
13+
extends: [
14+
'@nextcloud'
15+
],
16+
rules: {
17+
'jsdoc/require-jsdoc': 'off',
18+
'jsdoc/tag-lines': 'off',
19+
'vue/first-attribute-linebreak': 'off',
20+
'import/extensions': 'off',
21+
'import/no-unresolved': ['error', { 'ignore': ["\\?raw"] }],
22+
'vue/no-v-model-argument': 'off',
23+
'vue/no-v-html': 'off',
24+
'jsdoc/require-param-type': 'off',
25+
'jsdoc/require-param-description': 'off',
26+
}
927
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/appinfo/info.xml @LexioJ

.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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
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
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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-php-cs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 php-cs
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
24+
name: php-cs
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
30+
- name: Get php version
31+
id: versions
32+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
33+
34+
- name: Set up php${{ steps.versions.outputs.php-available }}
35+
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
36+
with:
37+
php-version: ${{ steps.versions.outputs.php-available }}
38+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
39+
coverage: none
40+
ini-file: development
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Install dependencies
45+
run: |
46+
composer remove nextcloud/ocp --dev
47+
composer i
48+
49+
- name: Lint
50+
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/lint-php.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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 php
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-php-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
matrix:
22+
runs-on: ubuntu-latest-low
23+
outputs:
24+
php-versions: ${{ steps.versions.outputs.php-versions }}
25+
steps:
26+
- name: Checkout app
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- name: Get version matrix
29+
id: versions
30+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
31+
32+
php-lint:
33+
runs-on: ubuntu-latest
34+
needs: matrix
35+
strategy:
36+
matrix:
37+
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
38+
39+
name: php-lint
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
45+
- name: Set up php ${{ matrix.php-versions }}
46+
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
47+
with:
48+
php-version: ${{ matrix.php-versions }}
49+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
50+
coverage: none
51+
ini-file: development
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Lint
56+
run: composer run lint
57+
58+
summary:
59+
permissions:
60+
contents: none
61+
runs-on: ubuntu-latest-low
62+
needs: php-lint
63+
64+
if: always()
65+
66+
name: php-lint-summary
67+
68+
steps:
69+
- name: Summary status
70+
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi

.github/workflows/node.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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: Node
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: node-${{ 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+
- '**.js'
44+
- '**.ts'
45+
- '**.vue'
46+
47+
build:
48+
runs-on: ubuntu-latest
49+
50+
needs: changes
51+
if: needs.changes.outputs.src != 'false'
52+
53+
name: NPM build
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
57+
58+
- name: Read package.json node and npm engines version
59+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
60+
id: versions
61+
with:
62+
fallbackNode: '^20'
63+
fallbackNpm: '^10'
64+
65+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
66+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
67+
with:
68+
node-version: ${{ steps.versions.outputs.nodeVersion }}
69+
70+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
71+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
72+
73+
- name: Install dependencies & build
74+
env:
75+
CYPRESS_INSTALL_BINARY: 0
76+
PUPPETEER_SKIP_DOWNLOAD: true
77+
run: |
78+
npm ci
79+
npm run build --if-present
80+
81+
- name: Check webpack build changes
82+
run: |
83+
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
84+
85+
- name: Show changes on failure
86+
if: failure()
87+
run: |
88+
git status
89+
git --no-pager diff
90+
exit 1 # make it red to grab attention
91+
92+
summary:
93+
permissions:
94+
contents: none
95+
runs-on: ubuntu-latest-low
96+
needs: [changes, build]
97+
98+
if: always()
99+
100+
# This is the summary, we just avoid to rename it so that branch protection rules still match
101+
name: node
102+
103+
steps:
104+
- name: Summary status
105+
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)