Skip to content

Commit 91bbff1

Browse files
committed
chore: update workflows from templates
Signed-off-by: John Molakvoæ <[email protected]>
1 parent ab5da57 commit 91bbff1

9 files changed

+237
-163
lines changed

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

+4-10
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55

66
name: Lint info.xml
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
@@ -22,18 +16,18 @@ concurrency:
2216

2317
jobs:
2418
xml-linters:
25-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-latest-low
2620

2721
name: info.xml lint
2822
steps:
2923
- name: Checkout
30-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3125

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

3529
- name: Lint info.xml
36-
uses: ChristophWurst/xmllint-action@39155a91429af431d65fafc21fa52ba5c4f5cb71 # v1.1
30+
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
3731
with:
3832
xml-file: ./appinfo/info.xml
3933
xml-schema-file: ./info.xsd

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,20 @@ 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@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
2929
with:
30-
php-version: 8.1
30+
php-version: 8.2
31+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3132
coverage: none
3233
ini-file: development
3334
env:
3435
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3536

3637
- name: Install dependencies
37-
run: composer install
38+
run: composer i
3839

3940
- name: Lint
4041
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/lint-php.yml

+6-11
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,18 +19,19 @@ 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@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
3832
with:
3933
php-version: ${{ matrix.php-versions }}
34+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
4035
coverage: none
4136
ini-file: development
4237
env:
@@ -48,7 +43,7 @@ jobs:
4843
summary:
4944
permissions:
5045
contents: none
51-
runs-on: ubuntu-latest
46+
runs-on: ubuntu-latest-low
5247
needs: php-lint
5348

5449
if: always()

.github/workflows/phpunit-mysql.yml

+56-33
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,58 @@ concurrency:
3315
cancel-in-progress: true
3416

3517
jobs:
18+
matrix:
19+
runs-on: ubuntu-latest-low
20+
outputs:
21+
matrix: ${{ steps.versions.outputs.sparse-matrix }}
22+
steps:
23+
- name: Checkout app
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
26+
- name: Get version matrix
27+
id: versions
28+
uses: icewind1991/nextcloud-version-matrix@d594a6929da316b732c53355e52a1ead77ba36c7 # v1.2.0
29+
with:
30+
matrix: '{"mysql-versions": ["8.1"]}'
31+
32+
changes:
33+
runs-on: ubuntu-latest-low
34+
35+
outputs:
36+
src: ${{ steps.changes.outputs.src}}
37+
38+
steps:
39+
- uses: dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd # v3.0.0
40+
id: changes
41+
continue-on-error: true
42+
with:
43+
filters: |
44+
src:
45+
- '.github/workflows/**'
46+
- 'appinfo/**'
47+
- 'lib/**'
48+
- 'templates/**'
49+
- 'tests/**'
50+
- 'vendor/**'
51+
- 'vendor-bin/**'
52+
- '.php-cs-fixer.dist.php'
53+
- 'composer.json'
54+
- 'composer.lock'
55+
3656
phpunit-mysql:
3757
runs-on: ubuntu-latest
3858

59+
needs: [changes, matrix]
60+
if: needs.changes.outputs.src != 'false'
61+
3962
strategy:
40-
matrix:
41-
php-versions: ['8.0', '8.1', '8.2']
42-
server-versions: ['master']
63+
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
64+
65+
name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
4366

4467
services:
4568
mysql:
46-
image: ghcr.io/nextcloud/continuous-integration-mariadb-10.6:latest
69+
image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest
4770
ports:
4871
- 4444:3306/tcp
4972
env:
@@ -57,19 +80,19 @@ jobs:
5780
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
5881
5982
- name: Checkout server
60-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
83+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6184
with:
6285
submodules: true
6386
repository: nextcloud/server
6487
ref: ${{ matrix.server-versions }}
6588

6689
- name: Checkout app
67-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
90+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6891
with:
6992
path: apps/${{ env.APP_NAME }}
7093

7194
- name: Set up php ${{ matrix.php-versions }}
72-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
95+
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
7396
with:
7497
php-version: ${{ matrix.php-versions }}
7598
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -86,15 +109,15 @@ jobs:
86109
87110
- name: Check composer file existence
88111
id: check_composer
89-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
112+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
90113
with:
91114
files: apps/${{ env.APP_NAME }}/composer.json
92115

93116
- name: Set up dependencies
94117
# Only run if phpunit config file exists
95118
if: steps.check_composer.outputs.files_exists == 'true'
96119
working-directory: apps/${{ env.APP_NAME }}
97-
run: composer install
120+
run: composer i
98121

99122
- name: Set up Nextcloud
100123
env:
@@ -150,13 +173,13 @@ jobs:
150173
summary:
151174
permissions:
152175
contents: none
153-
runs-on: ubuntu-latest
154-
needs: phpunit-mysql
176+
runs-on: ubuntu-latest-low
177+
needs: [changes, phpunit-mysql]
155178

156179
if: always()
157180

158181
name: phpunit-mysql-summary
159182

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

0 commit comments

Comments
 (0)