Skip to content

Commit 1d8d5f8

Browse files
authored
Merge pull request #541 from nextcloud/update-workflows
chore: Update workflows and use composer-bin
2 parents 0fe87a3 + f533401 commit 1d8d5f8

31 files changed

Lines changed: 6334 additions & 4623 deletions

.github/workflows/lint-eslint.yml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
6-
# Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions
7-
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
88

99
name: Lint eslint
1010

@@ -19,13 +19,16 @@ concurrency:
1919

2020
jobs:
2121
changes:
22-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
2326

2427
outputs:
2528
src: ${{ steps.changes.outputs.src}}
2629

2730
steps:
28-
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
2932
id: changes
3033
continue-on-error: true
3134
with:
@@ -53,22 +56,24 @@ jobs:
5356

5457
steps:
5558
- name: Checkout
56-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
59+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
60+
with:
61+
persist-credentials: false
5762

5863
- name: Read package.json node and npm engines version
59-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
64+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
6065
id: versions
6166
with:
6267
fallbackNode: '^20'
63-
fallbackNpm: '^9'
68+
fallbackNpm: '^10'
6469

6570
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
66-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
71+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6772
with:
6873
node-version: ${{ steps.versions.outputs.nodeVersion }}
6974

7075
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
71-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
76+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
7277

7378
- name: Install dependencies
7479
env:
@@ -82,7 +87,7 @@ jobs:
8287
summary:
8388
permissions:
8489
contents: none
85-
runs-on: ubuntu-latest
90+
runs-on: ubuntu-latest-low
8691
needs: [changes, lint]
8792

8893
if: always()

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint php-cs
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
24+
name: php-cs
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
31+
32+
- name: Get php version
33+
id: versions
34+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
35+
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
38+
with:
39+
php-version: ${{ steps.versions.outputs.php-min }}
40+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
41+
coverage: none
42+
ini-file: development
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Install dependencies
47+
run: |
48+
composer remove nextcloud/ocp --dev --no-scripts
49+
composer i
50+
51+
- name: Lint
52+
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: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: Lint php
710

@@ -15,22 +18,40 @@ concurrency:
1518
cancel-in-progress: true
1619

1720
jobs:
21+
matrix:
22+
runs-on: ubuntu-latest-low
23+
outputs:
24+
php-versions: ${{ steps.versions.outputs.php-versions }}
25+
steps:
26+
- name: Checkout app
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
30+
31+
- name: Get version matrix
32+
id: versions
33+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0
34+
1835
php-lint:
1936
runs-on: ubuntu-latest
37+
needs: matrix
2038
strategy:
2139
matrix:
22-
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]
40+
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
2341

2442
name: php-lint
2543

2644
steps:
2745
- name: Checkout
28-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
46+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
47+
with:
48+
persist-credentials: false
2949

3050
- name: Set up php ${{ matrix.php-versions }}
31-
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
51+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
3252
with:
3353
php-version: ${{ matrix.php-versions }}
54+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
3455
coverage: none
3556
ini-file: development
3657
env:
@@ -42,7 +63,7 @@ jobs:
4263
summary:
4364
permissions:
4465
contents: none
45-
runs-on: ubuntu-latest
66+
runs-on: ubuntu-latest-low
4667
needs: php-lint
4768

4869
if: always()

.github/workflows/node.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
58

69
name: Node
710

@@ -16,13 +19,16 @@ concurrency:
1619

1720
jobs:
1821
changes:
19-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
2026

2127
outputs:
2228
src: ${{ steps.changes.outputs.src}}
2329

2430
steps:
25-
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
2632
id: changes
2733
continue-on-error: true
2834
with:
@@ -47,22 +53,24 @@ jobs:
4753
name: NPM build
4854
steps:
4955
- name: Checkout
50-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
56+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
57+
with:
58+
persist-credentials: false
5159

5260
- name: Read package.json node and npm engines version
53-
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
61+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
5462
id: versions
5563
with:
5664
fallbackNode: '^20'
57-
fallbackNpm: '^9'
65+
fallbackNpm: '^10'
5866

5967
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
60-
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
68+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6169
with:
6270
node-version: ${{ steps.versions.outputs.nodeVersion }}
6371

6472
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
65-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
73+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
6674

6775
- name: Install dependencies & build
6876
env:
@@ -72,7 +80,7 @@ jobs:
7280
npm ci
7381
npm run build --if-present
7482
75-
- name: Check webpack build changes
83+
- name: Check build changes
7684
run: |
7785
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
7886
@@ -86,7 +94,7 @@ jobs:
8694
summary:
8795
permissions:
8896
contents: none
89-
runs-on: ubuntu-latest
97+
runs-on: ubuntu-latest-low
9098
needs: [changes, build]
9199

92100
if: always()

0 commit comments

Comments
 (0)