Skip to content

Commit 2afa3f4

Browse files
authored
Merge pull request #583 from nextcloud/update-master-php-testing-versions
chore(CI): Update master php testing versions and workflow templates
2 parents 48d4a3e + 9bbce67 commit 2afa3f4

10 files changed

Lines changed: 169 additions & 43 deletions

.github/workflows/command-compile.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,43 @@ jobs:
1818

1919
steps:
2020
- name: Check actor permission
21-
uses: skjnldsv/check-actor-permission@v2
21+
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
2222
with:
2323
require: write
2424

2525
- name: Add reaction on start
26-
uses: peter-evans/create-or-update-comment@v1
26+
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 # v2.1.0
2727
with:
2828
token: ${{ secrets.COMMAND_BOT_PAT }}
2929
repository: ${{ github.event.repository.full_name }}
3030
comment-id: ${{ github.event.comment.id }}
3131
reaction-type: "+1"
3232

3333
- name: Parse command
34-
uses: skjnldsv/parse-command-comment@master
34+
uses: skjnldsv/parse-command-comment@e9cb9d1df338afed4295a59bbe27b4da53fd38a8 # master
3535
id: command
3636

3737
# Init path depending on which command is run
3838
- name: Init path
3939
id: git-path
40-
run: |
40+
run: |
4141
if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then
42-
echo "::set-output name=path::${{ github.workspace }}${{steps.command.outputs.arg1}}"
42+
echo "path=${{ github.workspace }}${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT
4343
else
44-
echo "::set-output name=path::${{ github.workspace }}${{steps.command.outputs.arg2}}"
44+
echo "path=${{ github.workspace }}${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT
4545
fi
4646
4747
- name: Init branch
48-
uses: xt0rted/pull-request-comment-branch@v1
48+
uses: xt0rted/pull-request-comment-branch@653a7d5ca8bd91d3c5cb83286063314d0b063b8e # v1
4949
id: comment-branch
50-
50+
5151
process:
5252
runs-on: ubuntu-latest
5353
needs: init
5454

5555
steps:
5656
- name: Checkout ${{ needs.init.outputs.head_ref }}
57-
uses: actions/checkout@v3
57+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
5858
with:
5959
token: ${{ secrets.COMMAND_BOT_PAT }}
6060
fetch-depth: 0
@@ -66,14 +66,14 @@ jobs:
6666
git config --local user.name "nextcloud-command"
6767
6868
- name: Read package.json node and npm engines version
69-
uses: skjnldsv/read-package-engines-version-actions@v1.2
69+
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
7070
id: package-engines-versions
7171
with:
72-
fallbackNode: '^12'
73-
fallbackNpm: '^6'
72+
fallbackNode: '^16'
73+
fallbackNpm: '^7'
7474

7575
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
76-
uses: actions/setup-node@v3
76+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
7777
with:
7878
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
7979
cache: npm
@@ -108,7 +108,7 @@ jobs:
108108
git push --force origin ${{ needs.init.outputs.head_ref }}
109109
110110
- name: Add reaction on failure
111-
uses: peter-evans/create-or-update-comment@v1
111+
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 # v2.1.0
112112
if: failure()
113113
with:
114114
token: ${{ secrets.COMMAND_BOT_PAT }}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
permissions:
1616
contents: read
1717

18-
concurrency:
18+
concurrency:
1919
group: dependabot-approve-merge-${{ github.head_ref || github.run_id }}
2020
cancel-in-progress: true
2121

@@ -25,16 +25,16 @@ jobs:
2525
runs-on: ubuntu-latest
2626
permissions:
2727
# for hmarr/auto-approve-action to approve PRs
28-
pull-requests: write
28+
pull-requests: write
2929

3030
steps:
3131
# Github actions bot approve
32-
- uses: hmarr/auto-approve-action@v2
32+
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
3333
with:
3434
github-token: ${{ secrets.GITHUB_TOKEN }}
3535

3636
# Nextcloud bot approve and merge request
37-
- uses: ahmadnassri/action-dependabot-auto-merge@v2
37+
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
3838
with:
3939
target: minor
4040
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
# 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
8+
9+
name: Lint
10+
11+
on:
12+
pull_request:
13+
paths-ignore:
14+
- '.github/workflows/**'
15+
- 'src/**'
16+
- 'appinfo/info.xml'
17+
- 'package.json'
18+
- 'package-lock.json'
19+
- 'tsconfig.json'
20+
- '.eslintrc.*'
21+
- '.eslintignore'
22+
- '**.js'
23+
- '**.ts'
24+
- '**.vue'
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
lint:
31+
permissions:
32+
contents: none
33+
34+
runs-on: ubuntu-latest
35+
36+
name: eslint
37+
38+
steps:
39+
- run: 'echo "No eslint required"'

.github/workflows/lint-eslint.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,31 @@
22
#
33
# https://github.com/nextcloud/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
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
58

69
name: Lint
710

8-
on: pull_request
11+
on:
12+
pull_request:
13+
paths:
14+
- '.github/workflows/**'
15+
- 'src/**'
16+
- 'appinfo/info.xml'
17+
- 'package.json'
18+
- 'package-lock.json'
19+
- 'tsconfig.json'
20+
- '.eslintrc.*'
21+
- '.eslintignore'
22+
- '**.js'
23+
- '**.ts'
24+
- '**.vue'
925

1026
permissions:
1127
contents: read
1228

13-
concurrency:
29+
concurrency:
1430
group: lint-eslint-${{ github.head_ref || github.run_id }}
1531
cancel-in-progress: true
1632

@@ -22,17 +38,17 @@ jobs:
2238

2339
steps:
2440
- name: Checkout
25-
uses: actions/checkout@v3
41+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
2642

2743
- name: Read package.json node and npm engines version
28-
uses: skjnldsv/read-package-engines-version-actions@v1.2
44+
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
2945
id: versions
3046
with:
31-
fallbackNode: '^12'
32-
fallbackNpm: '^6'
47+
fallbackNode: '^16'
48+
fallbackNpm: '^7'
3349

3450
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
35-
uses: actions/setup-node@v3
51+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
3652
with:
3753
node-version: ${{ steps.versions.outputs.nodeVersion }}
3854

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on: pull_request
1010
permissions:
1111
contents: read
1212

13-
concurrency:
13+
concurrency:
1414
group: lint-php-cs-${{ github.head_ref || github.run_id }}
1515
cancel-in-progress: true
1616

@@ -22,13 +22,15 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
2626

2727
- name: Set up php
28-
uses: shivammathur/setup-php@v2
28+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
2929
with:
30-
php-version: "7.4"
30+
php-version: 8.1
3131
coverage: none
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3234

3335
- name: Install dependencies
3436
run: composer i

.github/workflows/lint-php.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,44 @@ on:
99
pull_request:
1010
push:
1111
branches:
12+
- main
1213
- master
1314
- stable*
1415

16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: lint-php-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
1523
jobs:
1624
php-lint:
1725
runs-on: ubuntu-latest
1826
strategy:
1927
matrix:
20-
php-versions: ["7.4", "8.0", "8.1"]
28+
php-versions: [ "8.0", "8.1", "8.2" ]
2129

2230
name: php-lint
2331

2432
steps:
2533
- name: Checkout
26-
uses: actions/checkout@v2
34+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
2735

2836
- name: Set up php ${{ matrix.php-versions }}
29-
uses: shivammathur/setup-php@v2
37+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
3038
with:
3139
php-version: ${{ matrix.php-versions }}
3240
coverage: none
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3343

3444
- name: Lint
3545
run: composer run lint
3646

3747
summary:
48+
permissions:
49+
contents: none
3850
runs-on: ubuntu-latest
3951
needs: php-lint
4052

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Use node together with node-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
8+
9+
name: Node
10+
11+
on:
12+
pull_request:
13+
paths-ignore:
14+
- '.github/workflows/**'
15+
- 'src/**'
16+
- 'appinfo/info.xml'
17+
- 'package.json'
18+
- 'package-lock.json'
19+
- 'tsconfig.json'
20+
- '**.js'
21+
- '**.ts'
22+
- '**.vue'
23+
push:
24+
branches:
25+
- main
26+
- master
27+
- stable*
28+
29+
concurrency:
30+
group: node-${{ github.head_ref || github.run_id }}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
build:
35+
permissions:
36+
contents: none
37+
38+
runs-on: ubuntu-latest
39+
40+
name: node
41+
steps:
42+
- name: Skip
43+
run: 'echo "No JS/TS files changed, skipped Node"'

.github/workflows/node.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ name: Node
77

88
on:
99
pull_request:
10+
paths:
11+
- '.github/workflows/**'
12+
- 'src/**'
13+
- 'appinfo/info.xml'
14+
- 'package.json'
15+
- 'package-lock.json'
16+
- 'tsconfig.json'
17+
- '**.js'
18+
- '**.ts'
19+
- '**.vue'
1020
push:
1121
branches:
1222
- main
@@ -16,24 +26,28 @@ on:
1626
permissions:
1727
contents: read
1828

29+
concurrency:
30+
group: node-${{ github.head_ref || github.run_id }}
31+
cancel-in-progress: true
32+
1933
jobs:
2034
build:
2135
runs-on: ubuntu-latest
2236

2337
name: node
2438
steps:
2539
- name: Checkout
26-
uses: actions/checkout@v3
40+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
2741

2842
- name: Read package.json node and npm engines version
29-
uses: skjnldsv/read-package-engines-version-actions@v1.2
43+
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
3044
id: versions
3145
with:
32-
fallbackNode: '^12'
33-
fallbackNpm: '^6'
46+
fallbackNode: '^16'
47+
fallbackNpm: '^7'
3448

3549
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
36-
uses: actions/setup-node@v3
50+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
3751
with:
3852
node-version: ${{ steps.versions.outputs.nodeVersion }}
3953

@@ -55,4 +69,3 @@ jobs:
5569
git status
5670
git --no-pager diff
5771
exit 1 # make it red to grab attention
58-

0 commit comments

Comments
 (0)