Skip to content

Commit f41197c

Browse files
Merge pull request #470 from nextcloud/bugfix/469/fix-submitting-final-form-with-chrome
📨 Fix submitting the final form in chrome + 🧹 Cleanup
2 parents 1509bb8 + cde613c commit f41197c

21 files changed

+362
-160
lines changed

.github/workflows/lint-eslint.yml

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

66
name: Lint
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- main
13-
- master
14-
- stable*
8+
on: pull_request
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: lint-eslint-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
1516

1617
jobs:
1718
lint:

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,25 @@ 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-info-xml-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
1523
jobs:
1624
xml-linters:
1725
runs-on: ubuntu-latest
1826

1927
name: info.xml lint
2028
steps:
2129
- name: Checkout
22-
uses: actions/checkout@master
30+
uses: actions/checkout@v3
2331

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

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
name: Lint
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- master
13-
- stable*
8+
on: pull_request
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
1416

1517
jobs:
1618
lint:
@@ -20,9 +22,9 @@ jobs:
2022

2123
steps:
2224
- name: Checkout
23-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2426

25-
- name: Set up php ${{ matrix.php-versions }}
27+
- name: Set up php
2628
uses: shivammathur/setup-php@v2
2729
with:
2830
php-version: "7.4"

.github/workflows/lint-php.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
name: Lint
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- master
13-
- stable*
8+
on: pull_request
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: lint-php-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
1416

1517
jobs:
1618
php-lint:
@@ -23,7 +25,7 @@ jobs:
2325

2426
steps:
2527
- name: Checkout
26-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2729

2830
- name: Set up php ${{ matrix.php-versions }}
2931
uses: shivammathur/setup-php@v2
@@ -35,6 +37,8 @@ jobs:
3537
run: composer run lint
3638

3739
summary:
40+
permissions:
41+
contents: none
3842
runs-on: ubuntu-latest
3943
needs: php-lint
4044

.github/workflows/lint-stylelint.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
name: Lint
77

8-
on:
9-
pull_request:
10-
push:
11-
branches:
12-
- master
13-
- stable*
8+
on: pull_request
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: lint-stylelint-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
1416

1517
jobs:
1618
lint:
@@ -20,17 +22,17 @@ jobs:
2022

2123
steps:
2224
- name: Checkout
23-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2426

2527
- name: Read package.json node and npm engines version
26-
uses: skjnldsv/read-package-engines-version-actions@v1.1
28+
uses: skjnldsv/read-package-engines-version-actions@v1.2
2729
id: versions
2830
with:
2931
fallbackNode: '^12'
3032
fallbackNpm: '^6'
3133

3234
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
33-
uses: actions/setup-node@v2
35+
uses: actions/setup-node@v3
3436
with:
3537
node-version: ${{ steps.versions.outputs.nodeVersion }}
3638

.github/workflows/node.yml

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

66
name: Node
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
1812

13+
concurrency:
14+
group: node-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
1917
jobs:
2018
build:
2119
runs-on: ubuntu-latest
@@ -44,13 +42,12 @@ jobs:
4442
run: |
4543
npm ci
4644
npm run build --if-present
47-
4845
- name: Check webpack build changes
4946
run: |
50-
bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
51-
47+
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
5248
- name: Show changes on failure
5349
if: failure()
5450
run: |
5551
git status
5652
git --no-pager diff
53+
exit 1 # make it red to grab attention

.github/workflows/phpunit-mysql.yml

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,44 @@
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+
16
name: PHPUnit
27

38
on:
49
pull_request:
5-
push:
6-
branches:
7-
- master
8-
- stable*
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+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: phpunit-mysql-${{ github.head_ref || github.run_id }}
27+
cancel-in-progress: true
928

1029
env:
11-
APP_NAME: registration
1230
# Location of the phpunit.xml and phpunit.integration.xml files
13-
# Comment to disable
1431
PHPUNIT_CONFIG: ./tests/phpunit.xml
15-
# PHPUNIT_INTEGRATION_CONFIG: ./tests/phpunit.integration.xml
32+
PHPUNIT_INTEGRATION_CONFIG: ./tests/phpunit.integration.xml
1633

1734
jobs:
1835
phpunit-mysql:
1936
runs-on: ubuntu-latest
2037

2138
strategy:
22-
# do not stop on another job's failure
23-
fail-fast: false
2439
matrix:
2540
php-versions: ['7.4', '8.0', '8.1']
26-
server-versions: ['master', 'stable25']
41+
server-versions: ['master']
2742

2843
services:
2944
mysql:
@@ -35,15 +50,25 @@ jobs:
3550
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
3651

3752
steps:
53+
- name: Set app env
54+
run: |
55+
# Split and keep last
56+
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
57+
58+
- name: Enable ONLY_FULL_GROUP_BY MySQL option
59+
run: |
60+
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
61+
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
62+
3863
- name: Checkout server
39-
uses: actions/checkout@v2
64+
uses: actions/checkout@v3
4065
with:
4166
submodules: true
4267
repository: nextcloud/server
4368
ref: ${{ matrix.server-versions }}
4469

4570
- name: Checkout app
46-
uses: actions/checkout@v2
71+
uses: actions/checkout@v3
4772
with:
4873
path: apps/${{ env.APP_NAME }}
4974

@@ -55,7 +80,15 @@ jobs:
5580
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql
5681
coverage: none
5782

83+
- name: Check composer file existence
84+
id: check_composer
85+
uses: andstor/file-existence-action@v1
86+
with:
87+
files: apps/${{ env.APP_NAME }}/composer.json
88+
5889
- name: Set up PHPUnit
90+
# Only run if phpunit config file exists
91+
if: steps.check_composer.outputs.files_exists == 'true'
5992
working-directory: apps/${{ env.APP_NAME }}
6093
run: composer i
6194

@@ -66,21 +99,39 @@ jobs:
6699
mkdir data
67100
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
68101
./occ app:enable --force ${{ env.APP_NAME }}
69-
php -S localhost:8080 &
102+
103+
- name: Check PHPUnit config file existence
104+
id: check_phpunit
105+
uses: andstor/file-existence-action@v1
106+
with:
107+
files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_CONFIG }}
70108

71109
- name: PHPUnit
72110
# Only run if phpunit config file exists
73-
if: env.PHPUNIT_CONFIG != ''
111+
if: steps.check_phpunit.outputs.files_exists == 'true'
74112
working-directory: apps/${{ env.APP_NAME }}
75113
run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_CONFIG }}
76114

115+
- name: Check PHPUnit integration config file existence
116+
id: check_integration
117+
uses: andstor/file-existence-action@v1
118+
with:
119+
files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_INTEGRATION_CONFIG }}
120+
121+
- name: Run Nextcloud
122+
# Only run if phpunit integration config file exists
123+
if: steps.check_integration.outputs.files_exists == 'true'
124+
run: php -S localhost:8080 &
125+
77126
- name: PHPUnit integration
78127
# Only run if phpunit integration config file exists
79-
if: env.PHPUNIT_INTEGRATION_CONFIG != ''
128+
if: steps.check_integration.outputs.files_exists == 'true'
80129
working-directory: apps/${{ env.APP_NAME }}
81130
run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}
82131

83132
summary:
133+
permissions:
134+
contents: none
84135
runs-on: ubuntu-latest
85136
needs: phpunit-mysql
86137

0 commit comments

Comments
 (0)