Skip to content

Commit cb4870b

Browse files
committed
ci: Update workflows from templates
Signed-off-by: Max <max@nextcloud.com>
1 parent 94d8466 commit cb4870b

15 files changed

Lines changed: 179 additions & 86 deletions

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# 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
58

69
name: Build and publish app release
710

@@ -29,7 +32,7 @@ jobs:
2932
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3033
3134
- name: Checkout
32-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
35+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3336
with:
3437
path: ${{ env.APP_NAME }}
3538

@@ -41,7 +44,7 @@ jobs:
4144
expression: "//info//dependencies//nextcloud/@min-version"
4245

4346
- name: Read package.json node and npm engines version
44-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
47+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4548
id: versions
4649
# Continue if no package.json
4750
continue-on-error: true
@@ -53,14 +56,14 @@ jobs:
5356
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5457
# Skip if no package.json
5558
if: ${{ steps.versions.outputs.nodeVersion }}
56-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
59+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5760
with:
5861
node-version: ${{ steps.versions.outputs.nodeVersion }}
5962

6063
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
6164
# Skip if no package.json
6265
if: ${{ steps.versions.outputs.npmVersion }}
63-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
66+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
6467

6568
- name: Get php version
6669
id: php-versions
@@ -69,7 +72,7 @@ jobs:
6972
filename: ${{ env.APP_NAME }}/appinfo/info.xml
7073

7174
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
72-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
75+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
7376
with:
7477
php-version: ${{ steps.php-versions.outputs.php-min }}
7578
coverage: none
@@ -78,7 +81,7 @@ jobs:
7881

7982
- name: Check composer.json
8083
id: check_composer
81-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
84+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
8285
with:
8386
files: "${{ env.APP_NAME }}/composer.json"
8487

@@ -96,11 +99,11 @@ jobs:
9699
run: |
97100
cd ${{ env.APP_NAME }}
98101
npm ci
99-
npm run build
102+
npm run build --if-present
100103
101104
- name: Check Krankerl config
102105
id: krankerl
103-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
106+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
104107
with:
105108
files: ${{ env.APP_NAME }}/krankerl.toml
106109

@@ -126,12 +129,12 @@ jobs:
126129
continue-on-error: true
127130
id: server-checkout
128131
run: |
129-
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
132+
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
130133
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
131134
unzip latest-$NCVERSION.zip
132135
133136
- name: Checkout server master fallback
134-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
137+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
135138
if: ${{ steps.server-checkout.outcome != 'success' }}
136139
with:
137140
submodules: true
@@ -145,7 +148,7 @@ jobs:
145148
tar -xvf ${{ env.APP_NAME }}.tar.gz
146149
cd ../../../
147150
# Setting up keys
148-
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
151+
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
149152
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
150153
# Signing
151154
php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}

.github/workflows/cypress.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
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: 2023-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
19
name: Cypress
210

311
on: pull_request
@@ -12,13 +20,13 @@ env:
1220

1321
# This represents the server branch to checkout.
1422
# Usually it's the base branch of the PR, but for pushes it's the branch itself.
15-
# e.g. 'main', 'stable27' or 'feature/my-feature
23+
# e.g. 'main', 'stable27' or 'feature/my-feature'
1624
# n.b. server will use head_ref, as we want to test the PR branch.
1725
BRANCH: ${{ github.base_ref || github.ref_name }}
1826

1927
jobs:
2028
init:
21-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-latest-low
2230
outputs:
2331
nodeVersion: ${{ steps.versions.outputs.nodeVersion }}
2432
npmVersion: ${{ steps.versions.outputs.npmVersion }}
@@ -27,12 +35,18 @@ jobs:
2735
PUPPETEER_SKIP_DOWNLOAD: true
2836

2937
steps:
38+
- name: Disabled on forks
39+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
40+
run: |
41+
echo 'Can not run cypress on forks'
42+
exit 1
43+
3044
- name: Checkout app
31-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3246

3347
- name: Check composer.json
3448
id: check_composer
35-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
49+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
3650
with:
3751
files: "composer.json"
3852

@@ -41,19 +55,19 @@ jobs:
4155
run: composer install --no-dev
4256

4357
- name: Read package.json node and npm engines version
44-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
58+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
4559
id: versions
4660
with:
4761
fallbackNode: "^20"
4862
fallbackNpm: "^10"
4963

5064
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
51-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
65+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5266
with:
5367
node-version: ${{ steps.versions.outputs.nodeVersion }}
5468

5569
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
56-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
70+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
5771

5872
- name: Install node dependencies & build app
5973
run: |
@@ -88,15 +102,15 @@ jobs:
88102
path: ./
89103

90104
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
91-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
105+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
92106
with:
93107
node-version: ${{ needs.init.outputs.nodeVersion }}
94108

95109
- name: Set up npm ${{ needs.init.outputs.npmVersion }}
96-
run: npm i -g npm@"${{ needs.init.outputs.npmVersion }}"
110+
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
97111

98112
- name: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }} cypress tests
99-
uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6.6.1
113+
uses: cypress-io/github-action@496e7dc0edc421a9de8a36a31c793340e00c61bf # v6.7.5
100114
with:
101115
record: ${{ secrets.CYPRESS_RECORD_KEY && true }}
102116
parallel: ${{ secrets.CYPRESS_RECORD_KEY && true }}
@@ -119,7 +133,7 @@ jobs:
119133
CYPRESS_GROUP: Run ${{ matrix.containers == 'component' && 'component' || 'E2E' }}
120134

121135
- name: Upload snapshots
122-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
136+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
123137
if: always()
124138
with:
125139
name: snapshots_${{ matrix.containers }}
@@ -130,14 +144,14 @@ jobs:
130144
run: docker logs nextcloud-cypress-tests-${{ env.APP_NAME }} > nextcloud.log
131145

132146
- name: Upload NC logs
133-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
147+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
134148
if: failure() && matrix.containers != 'component'
135149
with:
136150
name: nc_logs_${{ matrix.containers }}
137151
path: nextcloud.log
138152

139153
summary:
140-
runs-on: ubuntu-latest
154+
runs-on: ubuntu-latest-low
141155
needs: [init, cypress]
142156

143157
if: always()

.github/workflows/dependabot-approve-merge.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# 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
58

69
name: Dependabot
710

@@ -21,14 +24,20 @@ concurrency:
2124

2225
jobs:
2326
auto-approve-merge:
24-
if: github.actor == 'dependabot[bot]'
27+
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
2528
runs-on: ubuntu-latest-low
2629
permissions:
2730
# for hmarr/auto-approve-action to approve PRs
2831
pull-requests: write
2932

3033
steps:
31-
# Github actions bot approve
34+
- name: Disabled on forks
35+
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
36+
run: |
37+
echo 'Can not approve PRs from forks'
38+
exit 1
39+
40+
# GitHub actions bot approve
3241
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
3342
with:
3443
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/fixup.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# 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
58

69
name: Block fixup and squash commits
710

@@ -28,6 +31,6 @@ jobs:
2831

2932
steps:
3033
- name: Run check
31-
uses: skjnldsv/block-fixup-merge-action@42d26e1b536ce61e5cf467d65fb76caf4aa85acf # v1
34+
uses: skjnldsv/block-fixup-merge-action@c138ea99e45e186567b64cf065ce90f7158c236a # v2
3235
with:
3336
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# 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
58

69
name: Lint info.xml
710

@@ -21,7 +24,7 @@ jobs:
2124
name: info.xml lint
2225
steps:
2326
- name: Checkout
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2528

2629
- name: Download schema
2730
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd

.github/workflows/lint-php-cs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# 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
58

69
name: Lint php-cs
710

@@ -22,14 +25,14 @@ jobs:
2225

2326
steps:
2427
- name: Checkout
25-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2629

2730
- name: Get php version
2831
id: versions
2932
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3033

3134
- name: Set up php${{ steps.versions.outputs.php-available }}
32-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
35+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
3336
with:
3437
php-version: ${{ steps.versions.outputs.php-available }}
3538
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/lint-php.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# 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
58

69
name: Lint php
710

@@ -21,7 +24,7 @@ jobs:
2124
php-versions: ${{ steps.versions.outputs.php-versions }}
2225
steps:
2326
- name: Checkout app
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2528
- name: Get version matrix
2629
id: versions
2730
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
@@ -37,10 +40,10 @@ jobs:
3740

3841
steps:
3942
- name: Checkout
40-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
43+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4144

4245
- name: Set up php ${{ matrix.php-versions }}
43-
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
46+
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
4447
with:
4548
php-version: ${{ matrix.php-versions }}
4649
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

0 commit comments

Comments
 (0)