Skip to content

Commit 957ed7f

Browse files
authored
Merge pull request #26 from LibreCodeCoop/feature/bump-ci
Update ci scripts
2 parents a7ab9bf + b87156b commit 957ed7f

10 files changed

+211
-173
lines changed

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

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ on:
99
release:
1010
types: [published]
1111

12-
env:
13-
PHP_VERSION: 8.1
14-
1512
jobs:
1613
build_and_publish:
1714
runs-on: ubuntu-latest
1815

19-
# # Only allowed to be run on nextcloud-releases repositories
20-
# if: ${{ github.repository_owner == 'nextcloud-releases' }}
16+
# Only allowed to be run on nextcloud-releases repositories
17+
if: ${{ github.repository_owner == 'nextcloud-releases' }}
2118

2219
steps:
2320
- name: Check actor permission
24-
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
21+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
2522
with:
2623
require: write
2724

@@ -32,7 +29,7 @@ jobs:
3229
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
3330
3431
- name: Checkout
35-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
32+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3633
with:
3734
path: ${{ env.APP_NAME }}
3835

@@ -44,19 +41,19 @@ jobs:
4441
expression: "//info//dependencies//nextcloud/@min-version"
4542

4643
- name: Read package.json node and npm engines version
47-
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
44+
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
4845
id: versions
4946
# Continue if no package.json
5047
continue-on-error: true
5148
with:
5249
path: ${{ env.APP_NAME }}
53-
fallbackNode: "^16"
54-
fallbackNpm: "^7"
50+
fallbackNode: '^20'
51+
fallbackNpm: '^10'
5552

5653
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
5754
# Skip if no package.json
5855
if: ${{ steps.versions.outputs.nodeVersion }}
59-
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
56+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v3
6057
with:
6158
node-version: ${{ steps.versions.outputs.nodeVersion }}
6259

@@ -65,17 +62,23 @@ jobs:
6562
if: ${{ steps.versions.outputs.npmVersion }}
6663
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
6764

68-
- name: Set up php ${{ env.PHP_VERSION }}
69-
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
65+
- name: Get php version
66+
id: php-versions
67+
uses: icewind1991/nextcloud-version-matrix@7d433286e92318f51ed0537b6c77374759e12f46 # v1.3.0
7068
with:
71-
php-version: ${{ env.PHP_VERSION }}
69+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
70+
71+
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
72+
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
73+
with:
74+
php-version: ${{ steps.php-versions.outputs.php-min }}
7275
coverage: none
7376
env:
7477
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7578

7679
- name: Check composer.json
7780
id: check_composer
78-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
81+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
7982
with:
8083
files: "${{ env.APP_NAME }}/composer.json"
8184

@@ -88,14 +91,16 @@ jobs:
8891
- name: Build ${{ env.APP_NAME }}
8992
# Skip if no package.json
9093
if: ${{ steps.versions.outputs.nodeVersion }}
94+
env:
95+
CYPRESS_INSTALL_BINARY: 0
9196
run: |
9297
cd ${{ env.APP_NAME }}
9398
npm ci
9499
npm run build
95100
96101
- name: Check Krankerl config
97102
id: krankerl
98-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
103+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
99104
with:
100105
files: ${{ env.APP_NAME }}/krankerl.toml
101106

@@ -126,7 +131,7 @@ jobs:
126131
unzip latest-$NCVERSION.zip
127132
128133
- name: Checkout server master fallback
129-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
134+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
130135
if: ${{ steps.server-checkout.outcome != 'success' }}
131136
with:
132137
submodules: true
@@ -149,7 +154,7 @@ jobs:
149154
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
150155
151156
- name: Attach tarball to github release
152-
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 # v2
157+
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2
153158
id: attach_to_release
154159
with:
155160
repo_token: ${{ secrets.GITHUB_TOKEN }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222
jobs:
2323
auto-approve-merge:
2424
if: github.actor == 'dependabot[bot]'
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-latest-low
2626
permissions:
2727
# for hmarr/auto-approve-action to approve PRs
2828
pull-requests: write

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

Lines changed: 4 additions & 10 deletions
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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,17 @@ 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: Get php version
28+
id: versions
29+
uses: icewind1991/nextcloud-version-matrix@7d433286e92318f51ed0537b6c77374759e12f46 # v1.3.0
30+
31+
- name: Set up php${{ steps.versions.outputs.php-available }}
32+
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
2933
with:
30-
php-version: 8.1
34+
php-version: ${{ steps.versions.outputs.php-available }}
35+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3136
coverage: none
3237
ini-file: development
3338
env:

.github/workflows/lint-php.yml

Lines changed: 18 additions & 11 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
@@ -21,22 +15,35 @@ concurrency:
2115
cancel-in-progress: true
2216

2317
jobs:
18+
matrix:
19+
runs-on: ubuntu-latest-low
20+
outputs:
21+
php-versions: ${{ steps.versions.outputs.php-versions }}
22+
steps:
23+
- name: Checkout app
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
- name: Get version matrix
26+
id: versions
27+
uses: icewind1991/nextcloud-version-matrix@111919cfc7b388b7c02cac3c5d53627137adb89f # v1.0.0
28+
2429
php-lint:
2530
runs-on: ubuntu-latest
31+
needs: matrix
2632
strategy:
2733
matrix:
28-
php-versions: [ "8.0", "8.1", "8.2" ]
34+
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
2935

3036
name: php-lint
3137

3238
steps:
3339
- name: Checkout
34-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
40+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3541

3642
- name: Set up php ${{ matrix.php-versions }}
37-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
43+
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
3844
with:
3945
php-version: ${{ matrix.php-versions }}
46+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
4047
coverage: none
4148
ini-file: development
4249
env:
@@ -48,7 +55,7 @@ jobs:
4855
summary:
4956
permissions:
5057
contents: none
51-
runs-on: ubuntu-latest
58+
runs-on: ubuntu-latest-low
5259
needs: php-lint
5360

5461
if: always()

.github/workflows/phpunit-sqlite.yml

Lines changed: 54 additions & 30 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 sqlite
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 SQLite
7+
8+
on: pull_request
279

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

3517
jobs:
18+
matrix:
19+
runs-on: ubuntu-latest-low
20+
outputs:
21+
php-version: ${{ steps.versions.outputs.php-available-list }}
22+
server-max: ${{ steps.versions.outputs.branches-max-list }}
23+
steps:
24+
- name: Checkout app
25+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26+
27+
- name: Get version matrix
28+
id: versions
29+
uses: icewind1991/nextcloud-version-matrix@7d433286e92318f51ed0537b6c77374759e12f46 # v1.3.0
30+
31+
changes:
32+
runs-on: ubuntu-latest-low
33+
34+
outputs:
35+
src: ${{ steps.changes.outputs.src}}
36+
37+
steps:
38+
- uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
39+
id: changes
40+
continue-on-error: true
41+
with:
42+
filters: |
43+
src:
44+
- '.github/workflows/**'
45+
- 'appinfo/**'
46+
- 'lib/**'
47+
- 'templates/**'
48+
- 'tests/**'
49+
- 'vendor/**'
50+
- 'vendor-bin/**'
51+
- '.php-cs-fixer.dist.php'
52+
- 'composer.json'
53+
- 'composer.lock'
54+
3655
phpunit-sqlite:
3756
runs-on: ubuntu-latest
3857

58+
needs: [changes, matrix]
59+
if: needs.changes.outputs.src != 'false'
60+
3961
strategy:
4062
matrix:
41-
php-versions: ['8.0']
42-
server-versions: ['master']
63+
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
64+
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
65+
66+
name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
4367

4468
steps:
4569
- name: Set app env
@@ -48,19 +72,19 @@ jobs:
4872
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
4973
5074
- name: Checkout server
51-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
75+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5276
with:
5377
submodules: true
5478
repository: nextcloud/server
5579
ref: ${{ matrix.server-versions }}
5680

5781
- name: Checkout app
58-
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
82+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5983
with:
6084
path: apps/${{ env.APP_NAME }}
6185

6286
- name: Set up php ${{ matrix.php-versions }}
63-
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
87+
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d # v2
6488
with:
6589
php-version: ${{ matrix.php-versions }}
6690
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -72,7 +96,7 @@ jobs:
7296

7397
- name: Check composer file existence
7498
id: check_composer
75-
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
99+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v2
76100
with:
77101
files: apps/${{ env.APP_NAME }}/composer.json
78102

@@ -136,13 +160,13 @@ jobs:
136160
summary:
137161
permissions:
138162
contents: none
139-
runs-on: ubuntu-latest
140-
needs: phpunit-sqlite
163+
runs-on: ubuntu-latest-low
164+
needs: [changes, phpunit-sqlite]
141165

142166
if: always()
143167

144168
name: phpunit-sqlite-summary
145169

146170
steps:
147171
- name: Summary status
148-
run: if ${{ needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi
172+
run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)