Skip to content

Commit e2521e0

Browse files
committed
ci: update all workflow templates from organization template repository
Signed-off-by: Nextcloud bot <[email protected]>
1 parent df53925 commit e2521e0

File tree

9 files changed

+111
-41
lines changed

9 files changed

+111
-41
lines changed

.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-php-cs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3535

3636
- name: Set up php${{ steps.versions.outputs.php-min }}
37-
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
37+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
3838
with:
3939
php-version: ${{ steps.versions.outputs.php-min }}
4040
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
@@ -44,7 +44,9 @@ jobs:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545

4646
- name: Install dependencies
47-
run: composer i
47+
run: |
48+
composer remove nextcloud/ocp --dev --no-scripts
49+
composer i
4850
4951
- name: Lint
5052
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
- name: Get version matrix
3232
id: versions
33-
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
33+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
3434

3535
php-lint:
3636
runs-on: ubuntu-latest
@@ -48,7 +48,7 @@ jobs:
4848
persist-credentials: false
4949

5050
- name: Set up php ${{ matrix.php-versions }}
51-
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
51+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
5252
with:
5353
php-version: ${{ matrix.php-versions }}
5454
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: 14 additions & 5 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', 'stable32', 'stable31', 'stable30', 'stable29']
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@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
51+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
4352
with:
4453
node-version: ${{ steps.versions.outputs.nodeVersion }}
4554

@@ -51,15 +60,15 @@ jobs:
5160
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()
71+
if: steps.checkout.outcome == 'success'
6372
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
6473
with:
6574
token: ${{ secrets.COMMAND_BOT_PAT }}

.github/workflows/phpunit-mariadb.yml

Lines changed: 17 additions & 12 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,49 +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', '11.4']
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:
8183
MARIADB_ROOT_PASSWORD: rootpassword
82-
options: >-
83-
--health-cmd="mariadb-admin ping"
84-
--health-interval=5s
85-
--health-timeout=2s
86-
--health-retries=5
84+
options: --health-cmd="mariadb-admin ping" --health-interval 5s --health-timeout 2s --health-retries 5
8785

8886
steps:
8987
- name: Set app env
88+
if: ${{ env.APP_NAME == '' }}
9089
run: |
9190
# Split and keep last
9291
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
9392
9493
- name: Checkout server
95-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9695
with:
96+
persist-credentials: false
9797
submodules: true
9898
repository: nextcloud/server
9999
ref: ${{ matrix.server-versions }}
100100

101101
- name: Checkout app
102-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
102+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
103103
with:
104+
persist-credentials: false
104105
path: apps/${{ env.APP_NAME }}
105106

106107
- name: Set up php ${{ matrix.php-versions }}
107-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # 2.35.3
108+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
108109
with:
109110
php-version: ${{ matrix.php-versions }}
110111
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
111112
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql
112113
coverage: none
113114
ini-file: development
115+
# Temporary workaround for missing pcntl_* in PHP 8.3
116+
ini-values: disable_functions=
114117
env:
115118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116119

@@ -129,7 +132,9 @@ jobs:
129132
# Only run if phpunit config file exists
130133
if: steps.check_composer.outputs.files_exists == 'true'
131134
working-directory: apps/${{ env.APP_NAME }}
132-
run: composer i
135+
run: |
136+
composer remove nextcloud/ocp --dev --no-scripts
137+
composer i
133138
134139
- name: Set up Nextcloud
135140
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@20529878ed81ef8e78ddf08b480401e6101a850f # 2.35.3
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@20529878ed81ef8e78ddf08b480401e6101a850f # 2.35.3
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:

.github/workflows/psalm.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,49 @@ concurrency:
1414
group: psalm-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

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

2124
name: static-psalm-analysis
2225
steps:
2326
- name: Checkout
24-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
2530

2631
- name: Get php version
2732
id: versions
2833
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
2934

35+
- name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml
36+
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml
37+
3038
- name: Set up php${{ steps.versions.outputs.php-available }}
31-
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # 2.35.3
39+
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5
3240
with:
3341
php-version: ${{ steps.versions.outputs.php-available }}
3442
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3543
coverage: none
3644
ini-file: development
45+
# Temporary workaround for missing pcntl_* in PHP 8.3
46+
ini-values: disable_functions=
3747
env:
3848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3949

4050
- name: Install dependencies
41-
run: composer i
51+
run: |
52+
composer remove nextcloud/ocp --dev --no-scripts
53+
composer i
54+
55+
- name: Check for vulnerable PHP dependencies
56+
run: composer require --dev roave/security-advisories:dev-latest
57+
58+
- name: Install nextcloud/ocp
59+
run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies
4260

4361
- name: Run coding standards check
44-
run: composer run psalm
62+
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github

0 commit comments

Comments
 (0)