Skip to content

Commit 62c4eab

Browse files
committed
ci: update all workflow templates from organization template repository
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
1 parent 1febcc5 commit 62c4eab

11 files changed

Lines changed: 141 additions & 50 deletions

.github/workflows/block-merge-freeze.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,29 @@ jobs:
2929

3030
steps:
3131
- name: Register server reference to fallback to master branch
32-
run: |
33-
server_ref="$(if [ '${{ github.base_ref }}' = 'main' ]; then echo -n 'master'; else echo -n '${{ github.base_ref }}'; fi)"
34-
echo "server_ref=$server_ref" >> $GITHUB_ENV
32+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
33+
with:
34+
github-token: ${{secrets.GITHUB_TOKEN}}
35+
script: |
36+
const baseRef = context.payload.pull_request.base.ref
37+
if (baseRef === 'main' || baseRef === 'master') {
38+
core.exportVariable('server_ref', 'master');
39+
console.log('Setting server_ref to master');
40+
} else {
41+
const regex = /^stable(\d+)$/
42+
const match = baseRef.match(regex)
43+
if (match) {
44+
core.exportVariable('server_ref', match[0]);
45+
console.log('Setting server_ref to ' + match[0]);
46+
} else {
47+
console.log('Not based on master/main/stable*, so skipping freeze check');
48+
}
49+
}
50+
3551
- name: Download version.php from ${{ env.server_ref }}
52+
if: ${{ env.server_ref != '' }}
3653
run: curl 'https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php' --output version.php
3754

3855
- name: Run check
56+
if: ${{ env.server_ref != '' }}
3957
run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC'

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424
name: info.xml lint
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
2830

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

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get php version
3133
id: versions
3234
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3335

34-
- name: Set up php${{ steps.versions.outputs.php-available }}
35-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
3638
with:
37-
php-version: ${{ steps.versions.outputs.php-available }}
39+
php-version: ${{ steps.versions.outputs.php-min }}
3840
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3941
coverage: none
4042
ini-file: development
4143
env:
4244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4345

4446
- name: Install dependencies
45-
run: composer i
47+
run: |
48+
composer remove nextcloud/ocp --dev --no-scripts
49+
composer i
4650
4751
- name: Lint
4852
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ jobs:
2424
php-versions: ${{ steps.versions.outputs.php-versions }}
2525
steps:
2626
- name: Checkout app
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
30+
2831
- name: Get version matrix
2932
id: versions
30-
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
33+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
3134

3235
php-lint:
3336
runs-on: ubuntu-latest
@@ -40,10 +43,12 @@ jobs:
4043

4144
steps:
4245
- name: Checkout
43-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
47+
with:
48+
persist-credentials: false
4449

4550
- name: Set up php ${{ matrix.php-versions }}
46-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
51+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
4752
with:
4853
php-version: ${{ matrix.php-versions }}
4954
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/npm-audit-fix.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,31 @@ on:
1414
# At 2:30 on Sundays
1515
- cron: '30 2 * * 0'
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
runs-on: ubuntu-latest
2023

2124
strategy:
2225
fail-fast: false
2326
matrix:
24-
branches: ['main', 'master', 'stable30', 'stable29', 'stable28']
27+
branches:
28+
- ${{ github.event.repository.default_branch }}
29+
- 'stable32'
30+
- 'stable31'
2531

2632
name: npm-audit-fix-${{ matrix.branches }}
2733

2834
steps:
2935
- name: Checkout
30-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
id: checkout
37+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3138
with:
39+
persist-credentials: false
3240
ref: ${{ matrix.branches }}
41+
continue-on-error: true
3342

3443
- name: Read package.json node and npm engines version
3544
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
@@ -39,7 +48,7 @@ jobs:
3948
fallbackNpm: '^10'
4049

4150
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
42-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
51+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
4352
with:
4453
node-version: ${{ steps.versions.outputs.nodeVersion }}
4554

@@ -48,19 +57,19 @@ jobs:
4857

4958
- name: Fix npm audit
5059
id: npm-audit
51-
uses: nextcloud-libraries/npm-audit-action@2a60bd2e79cc77f2cc4d9a3fe40f1a69896f3a87 # v0.1.0
60+
uses: nextcloud-libraries/npm-audit-action@1b1728b2b4a7a78d69de65608efcf4db0e3e42d0 # v0.2.0
5261

5362
- name: Run npm ci and npm run build
54-
if: always()
63+
if: steps.checkout.outcome == 'success'
5564
env:
5665
CYPRESS_INSTALL_BINARY: 0
5766
run: |
5867
npm ci
5968
npm run build --if-present
6069
6170
- name: Create Pull Request
62-
if: always()
63-
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
71+
if: steps.checkout.outcome == 'success'
72+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
6473
with:
6574
token: ${{ secrets.COMMAND_BOT_PAT }}
6675
commit-message: 'fix(deps): Fix npm audit'

.github/workflows/phpunit-mariadb.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -68,45 +70,50 @@ jobs:
6870
matrix:
6971
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
7072
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
71-
mariadb-versions: ['10.6', '10.11']
73+
mariadb-versions: ['10.6', '11.4']
7274

7375
name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
7476

7577
services:
7678
mariadb:
77-
image: ghcr.io/nextcloud/continuous-integration-mariadb-${{ matrix.mariadb-versions }}:latest
79+
image: ghcr.io/nextcloud/continuous-integration-mariadb-${{ matrix.mariadb-versions }}:latest # zizmor: ignore[unpinned-images]
7880
ports:
7981
- 4444:3306/tcp
8082
env:
81-
MYSQL_ROOT_PASSWORD: rootpassword
82-
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
83+
MARIADB_ROOT_PASSWORD: rootpassword
84+
options: --health-cmd="mariadb-admin ping" --health-interval 5s --health-timeout 2s --health-retries 5
8385

8486
steps:
8587
- name: Set app env
88+
if: ${{ env.APP_NAME == '' }}
8689
run: |
8790
# Split and keep last
8891
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
8992
9093
- name: Checkout server
91-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9295
with:
96+
persist-credentials: false
9397
submodules: true
9498
repository: nextcloud/server
9599
ref: ${{ matrix.server-versions }}
96100

97101
- name: Checkout app
98-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
102+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
99103
with:
104+
persist-credentials: false
100105
path: apps/${{ env.APP_NAME }}
101106

102107
- name: Set up php ${{ matrix.php-versions }}
103-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
108+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
104109
with:
105110
php-version: ${{ matrix.php-versions }}
106111
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
107112
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
108113
coverage: none
109114
ini-file: development
115+
# Temporary workaround for missing pcntl_* in PHP 8.3
116+
ini-values: disable_functions=
110117
env:
111118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112119

@@ -125,7 +132,9 @@ jobs:
125132
# Only run if phpunit config file exists
126133
if: steps.check_composer.outputs.files_exists == 'true'
127134
working-directory: apps/${{ env.APP_NAME }}
128-
run: composer i
135+
run: |
136+
composer remove nextcloud/ocp --dev --no-scripts
137+
composer i
129138
130139
- name: Set up Nextcloud
131140
env:

.github/workflows/phpunit-pgsql.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -73,7 +75,7 @@ jobs:
7375

7476
services:
7577
postgres:
76-
image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest
78+
image: ghcr.io/nextcloud/continuous-integration-postgres-16:latest # zizmor: ignore[unpinned-images]
7779
ports:
7880
- 4444:5432/tcp
7981
env:
@@ -84,30 +86,35 @@ jobs:
8486

8587
steps:
8688
- name: Set app env
89+
if: ${{ env.APP_NAME == '' }}
8790
run: |
8891
# Split and keep last
8992
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9093
9194
- name: Checkout server
92-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
95+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9396
with:
97+
persist-credentials: false
9498
submodules: true
9599
repository: nextcloud/server
96100
ref: ${{ matrix.server-versions }}
97101

98102
- name: Checkout app
99-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
100104
with:
105+
persist-credentials: false
101106
path: apps/${{ env.APP_NAME }}
102107

103108
- name: Set up php ${{ matrix.php-versions }}
104-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
109+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
105110
with:
106111
php-version: ${{ matrix.php-versions }}
107112
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
108113
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
109114
coverage: none
110115
ini-file: development
116+
# Temporary workaround for missing pcntl_* in PHP 8.3
117+
ini-values: disable_functions=
111118
env:
112119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113120

@@ -121,7 +128,9 @@ jobs:
121128
# Only run if phpunit config file exists
122129
if: steps.check_composer.outputs.files_exists == 'true'
123130
working-directory: apps/${{ env.APP_NAME }}
124-
run: composer i
131+
run: |
132+
composer remove nextcloud/ocp --dev --no-scripts
133+
composer i
125134
126135
- name: Set up Nextcloud
127136
env:

.github/workflows/phpunit-sqlite.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
server-max: ${{ steps.versions.outputs.branches-max-list }}
2626
steps:
2727
- name: Checkout app
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
2931

3032
- name: Get version matrix
3133
id: versions
@@ -73,30 +75,35 @@ jobs:
7375

7476
steps:
7577
- name: Set app env
78+
if: ${{ env.APP_NAME == '' }}
7679
run: |
7780
# Split and keep last
7881
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
7982
8083
- name: Checkout server
81-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
84+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8285
with:
86+
persist-credentials: false
8387
submodules: true
8488
repository: nextcloud/server
8589
ref: ${{ matrix.server-versions }}
8690

8791
- name: Checkout app
88-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
92+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8993
with:
94+
persist-credentials: false
9095
path: apps/${{ env.APP_NAME }}
9196

9297
- name: Set up php ${{ matrix.php-versions }}
93-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
98+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
9499
with:
95100
php-version: ${{ matrix.php-versions }}
96101
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
97102
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
98103
coverage: none
99104
ini-file: development
105+
# Temporary workaround for missing pcntl_* in PHP 8.3
106+
ini-values: disable_functions=
100107
env:
101108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102109

@@ -110,7 +117,9 @@ jobs:
110117
# Only run if phpunit config file exists
111118
if: steps.check_composer.outputs.files_exists == 'true'
112119
working-directory: apps/${{ env.APP_NAME }}
113-
run: composer i
120+
run: |
121+
composer remove nextcloud/ocp --dev --no-scripts
122+
composer i
114123
115124
- name: Set up Nextcloud
116125
env:

0 commit comments

Comments
 (0)