Skip to content

Commit

Permalink
Merge pull request #470 from nextcloud/bugfix/469/fix-submitting-fina…
Browse files Browse the repository at this point in the history
…l-form-with-chrome

📨 Fix submitting the final form in chrome + 🧹 Cleanup
  • Loading branch information
nickvergessen authored Oct 14, 2022
2 parents 1509bb8 + cde613c commit f41197c
Show file tree
Hide file tree
Showing 21 changed files with 362 additions and 160 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

name: Lint

on:
pull_request:
push:
branches:
- main
- master
- stable*
on: pull_request

permissions:
contents: read

concurrency:
group: lint-eslint-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/lint-info-xml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ on:
pull_request:
push:
branches:
- main
- master
- stable*

permissions:
contents: read

concurrency:
group: lint-info-xml-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
xml-linters:
runs-on: ubuntu-latest

name: info.xml lint
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v3

- name: Download schema
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

name: Lint

on:
pull_request:
push:
branches:
- master
- stable*
on: pull_request

permissions:
contents: read

concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
Expand All @@ -20,9 +22,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up php ${{ matrix.php-versions }}
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

name: Lint

on:
pull_request:
push:
branches:
- master
- stable*
on: pull_request

permissions:
contents: read

concurrency:
group: lint-php-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
php-lint:
Expand All @@ -23,7 +25,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

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

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: php-lint

Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/lint-stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

name: Lint

on:
pull_request:
push:
branches:
- master
- stable*
on: pull_request

permissions:
contents: read

concurrency:
group: lint-stylelint-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
Expand All @@ -20,17 +22,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v1.1
uses: skjnldsv/read-package-engines-version-actions@v1.2
id: versions
with:
fallbackNode: '^12'
fallbackNpm: '^6'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@

name: Node

on:
pull_request:
push:
branches:
- main
- master
- stable*
on: pull_request

permissions:
contents: read

concurrency:
group: node-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,13 +42,12 @@ jobs:
run: |
npm ci
npm run build --if-present
- name: Check webpack build changes
run: |
bash -c "[[ ! \"`git status --porcelain `\" ]] || exit 1"
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
- name: Show changes on failure
if: failure()
run: |
git status
git --no-pager diff
exit 1 # make it red to grab attention
81 changes: 66 additions & 15 deletions .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: PHPUnit

on:
pull_request:
push:
branches:
- master
- stable*
paths:
- '.github/workflows/**'
- 'appinfo/**'
- 'lib/**'
- 'templates/**'
- 'tests/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

permissions:
contents: read

concurrency:
group: phpunit-mysql-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
APP_NAME: registration
# Location of the phpunit.xml and phpunit.integration.xml files
# Comment to disable
PHPUNIT_CONFIG: ./tests/phpunit.xml
# PHPUNIT_INTEGRATION_CONFIG: ./tests/phpunit.integration.xml
PHPUNIT_INTEGRATION_CONFIG: ./tests/phpunit.integration.xml

jobs:
phpunit-mysql:
runs-on: ubuntu-latest

strategy:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
server-versions: ['master', 'stable25']
server-versions: ['master']

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

steps:
- name: Set app env
run: |
# Split and keep last
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Enable ONLY_FULL_GROUP_BY MySQL option
run: |
echo "SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword
- name: Checkout server
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.server-versions }}

- name: Checkout app
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: apps/${{ env.APP_NAME }}

Expand All @@ -55,7 +80,15 @@ jobs:
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql
coverage: none

- name: Check composer file existence
id: check_composer
uses: andstor/file-existence-action@v1
with:
files: apps/${{ env.APP_NAME }}/composer.json

- name: Set up PHPUnit
# Only run if phpunit config file exists
if: steps.check_composer.outputs.files_exists == 'true'
working-directory: apps/${{ env.APP_NAME }}
run: composer i

Expand All @@ -66,21 +99,39 @@ jobs:
mkdir data
./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
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &
- name: Check PHPUnit config file existence
id: check_phpunit
uses: andstor/file-existence-action@v1
with:
files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_CONFIG }}

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

- name: Check PHPUnit integration config file existence
id: check_integration
uses: andstor/file-existence-action@v1
with:
files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_INTEGRATION_CONFIG }}

- name: Run Nextcloud
# Only run if phpunit integration config file exists
if: steps.check_integration.outputs.files_exists == 'true'
run: php -S localhost:8080 &

- name: PHPUnit integration
# Only run if phpunit integration config file exists
if: env.PHPUNIT_INTEGRATION_CONFIG != ''
if: steps.check_integration.outputs.files_exists == 'true'
working-directory: apps/${{ env.APP_NAME }}
run: ./vendor/phpunit/phpunit/phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: phpunit-mysql

Expand Down
Loading

0 comments on commit f41197c

Please sign in to comment.