Skip to content

Commit 0ddd61b

Browse files
committed
chore: update workflows from templates
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent fb6a6eb commit 0ddd61b

10 files changed

Lines changed: 171 additions & 140 deletions

.github/workflows/documentation.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,33 @@ jobs:
1212
name: Build and deploy
1313
steps:
1414
- name: Check actor permission level
15+
# Only allow admin to deploy on release
16+
if: github.event.release
1517
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2
1618
with:
1719
require: admin
1820

1921
- name: Checkout
20-
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
22+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2123

2224
- name: Read package.json node and npm engines version
23-
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
25+
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
2426
id: versions
2527
with:
26-
fallbackNode: '^16'
27-
fallbackNpm: '^8'
28+
fallbackNode: '^20'
29+
fallbackNpm: '^9'
2830

2931
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
30-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
32+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
3133
with:
3234
node-version: ${{ steps.versions.outputs.nodeVersion }}
3335

3436
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
3537
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
3638

3739
- name: Install dependencies & build
40+
env:
41+
CYPRESS_INSTALL_BINARY: 0
3842
run: |
3943
npm ci
4044
npm run build --if-present

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
25+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2626

27-
- name: Set up php
28-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
27+
- name: Set up php8.2
28+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
2929
with:
30-
php-version: 8.1
30+
php-version: 8.2
3131
coverage: none
3232
ini-file: development
3333
env:

.github/workflows/lint-php.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55

66
name: Lint php
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- main
13-
- master
14-
- stable*
8+
on: pull_request
159

1610
permissions:
1711
contents: read
@@ -25,16 +19,16 @@ jobs:
2519
runs-on: ubuntu-latest
2620
strategy:
2721
matrix:
28-
php-versions: [ "8.0", "8.1", "8.2" ]
22+
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]
2923

3024
name: php-lint
3125

3226
steps:
3327
- name: Checkout
34-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
28+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3529

3630
- name: Set up php ${{ matrix.php-versions }}
37-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
31+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
3832
with:
3933
php-version: ${{ matrix.php-versions }}
4034
coverage: none

.github/workflows/phpunit-mysql.yml

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,9 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55

6-
name: PHPUnit mysql
7-
8-
on:
9-
pull_request:
10-
paths:
11-
- '.github/workflows/**'
12-
- 'appinfo/**'
13-
- 'lib/**'
14-
- 'templates/**'
15-
- 'tests/**'
16-
- 'vendor/**'
17-
- 'vendor-bin/**'
18-
- '.php-cs-fixer.dist.php'
19-
- 'composer.json'
20-
- 'composer.lock'
21-
22-
push:
23-
branches:
24-
- main
25-
- master
26-
- stable*
6+
name: PHPUnit MySQL
7+
8+
on: pull_request
279

2810
permissions:
2911
contents: read
@@ -33,17 +15,47 @@ concurrency:
3315
cancel-in-progress: true
3416

3517
jobs:
18+
changes:
19+
runs-on: ubuntu-latest
20+
21+
outputs:
22+
src: ${{ steps.changes.outputs.src}}
23+
24+
steps:
25+
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
26+
id: changes
27+
continue-on-error: true
28+
with:
29+
filters: |
30+
src:
31+
- '.github/workflows/**'
32+
- 'appinfo/**'
33+
- 'lib/**'
34+
- 'templates/**'
35+
- 'tests/**'
36+
- 'vendor/**'
37+
- 'vendor-bin/**'
38+
- '.php-cs-fixer.dist.php'
39+
- 'composer.json'
40+
- 'composer.lock'
41+
3642
phpunit-mysql:
3743
runs-on: ubuntu-latest
3844

45+
needs: changes
46+
if: needs.changes.outputs.src != 'false'
47+
3948
strategy:
4049
matrix:
4150
php-versions: ['8.0', '8.1', '8.2', '8.3']
4251
server-versions: ['master']
52+
mysql-versions: ['8.1']
53+
54+
name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
4355

4456
services:
4557
mysql:
46-
image: ghcr.io/nextcloud/continuous-integration-mariadb-10.6:latest
58+
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest
4759
ports:
4860
- 4444:3306/tcp
4961
env:
@@ -57,19 +69,19 @@ jobs:
5769
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
5870
5971
- name: Checkout server
60-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
72+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6173
with:
6274
submodules: true
6375
repository: nextcloud/server
6476
ref: ${{ matrix.server-versions }}
6577

6678
- name: Checkout app
67-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
79+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6880
with:
6981
path: apps/${{ env.APP_NAME }}
7082

7183
- name: Set up php ${{ matrix.php-versions }}
72-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
84+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
7385
with:
7486
php-version: ${{ matrix.php-versions }}
7587
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -151,12 +163,12 @@ jobs:
151163
permissions:
152164
contents: none
153165
runs-on: ubuntu-latest
154-
needs: phpunit-mysql
166+
needs: [changes, phpunit-mysql]
155167

156168
if: always()
157169

158170
name: phpunit-mysql-summary
159171

160172
steps:
161173
- name: Summary status
162-
run: if ${{ needs.phpunit-mysql.result != 'success' }}; then exit 1; fi
174+
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi

.github/workflows/phpunit-oci.yml

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,7 @@
55

66
name: PHPUnit OCI
77

8-
on:
9-
pull_request:
10-
paths:
11-
- '.github/workflows/**'
12-
- 'appinfo/**'
13-
- 'lib/**'
14-
- 'templates/**'
15-
- 'tests/**'
16-
- 'vendor/**'
17-
- 'vendor-bin/**'
18-
- '.php-cs-fixer.dist.php'
19-
- 'composer.json'
20-
- 'composer.lock'
21-
22-
push:
23-
branches:
24-
- main
25-
- master
26-
- stable*
8+
on: pull_request
279

2810
permissions:
2911
contents: read
@@ -33,12 +15,39 @@ concurrency:
3315
cancel-in-progress: true
3416

3517
jobs:
36-
phpunit-oci:
18+
changes:
3719
runs-on: ubuntu-latest
3820

21+
outputs:
22+
src: ${{ steps.changes.outputs.src}}
23+
24+
steps:
25+
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
26+
id: changes
27+
continue-on-error: true
28+
with:
29+
filters: |
30+
src:
31+
- '.github/workflows/**'
32+
- 'appinfo/**'
33+
- 'lib/**'
34+
- 'templates/**'
35+
- 'tests/**'
36+
- 'vendor/**'
37+
- 'vendor-bin/**'
38+
- '.php-cs-fixer.dist.php'
39+
- 'composer.json'
40+
- 'composer.lock'
41+
42+
phpunit-oci:
43+
runs-on: ubuntu-22.04
44+
45+
needs: changes
46+
if: needs.changes.outputs.src != 'false'
47+
3948
strategy:
4049
matrix:
41-
php-versions: ['8.0']
50+
php-versions: ['8.2']
4251
server-versions: ['master']
4352

4453
services:
@@ -69,19 +78,19 @@ jobs:
6978
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
7079
7180
- name: Checkout server
72-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
81+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7382
with:
7483
submodules: true
7584
repository: nextcloud/server
7685
ref: ${{ matrix.server-versions }}
7786

7887
- name: Checkout app
79-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
88+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
8089
with:
8190
path: apps/${{ env.APP_NAME }}
8291

8392
- name: Set up php ${{ matrix.php-versions }}
84-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
93+
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
8594
with:
8695
php-version: ${{ matrix.php-versions }}
8796
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -158,12 +167,12 @@ jobs:
158167
permissions:
159168
contents: none
160169
runs-on: ubuntu-latest
161-
needs: phpunit-oci
170+
needs: [changes, phpunit-oci]
162171

163172
if: always()
164173

165174
name: phpunit-oci-summary
166175

167176
steps:
168177
- name: Summary status
169-
run: if ${{ needs.phpunit-oci.result != 'success' }}; then exit 1; fi
178+
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-oci.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)