Skip to content

Commit f8cd9cc

Browse files
authored
Merge pull request #1389 from nextcloud/chore/ci-updates
Move to more standard CI pipelines
2 parents f5b77f4 + c4e44a4 commit f8cd9cc

40 files changed

+3377
-251
lines changed

.github/workflows/appstore-build-publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ jobs:
3636
with:
3737
path: ${{ env.APP_NAME }}
3838

39+
- name: Get app version number
40+
id: app-version
41+
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
42+
with:
43+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
44+
expression: "//info//version/text()"
45+
46+
- name: Validate app version against tag
47+
run: |
48+
[ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
49+
3950
- name: Get appinfo data
4051
id: appinfo
4152
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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: 2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Block unconventional commits
10+
11+
on:
12+
pull_request:
13+
types: [opened, ready_for_review, reopened, synchronize]
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: block-unconventional-commits-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
block-unconventional-commits:
24+
name: Block unconventional commits
25+
26+
runs-on: ubuntu-latest-low
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
31+
32+
- uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0
33+
with:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.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-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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
44+
45+
- name: Set up php ${{ matrix.php-versions }}
46+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
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/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

0 commit comments

Comments
 (0)