Skip to content

Commit

Permalink
fix: update updater testing range for 25
Browse files Browse the repository at this point in the history
combined backport of #495

Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>

fix: fix actions hashes

Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>

fix: actions hashes

Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>

Adapt Makefile and signatures to test using newer versions

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

Fix test-cli tests as well

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

fix: update composer deps and box build workflow

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>

Install dependencies in workflows

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

Make sure all CI steps can run on PHP 8.0

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

Test beta update with cleaner beta

24.0.0beta2 has extra files which causes updater to complain. Moved the
   test to stable26.feature and use betas without extra files.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

Update updater.phar

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

Update CI workflows from master branch

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

fix: psalm

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>

Update updater.phar and index.php

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
skjnldsv authored and blizzz committed Sep 19, 2023
1 parent 7b4410f commit 7f59f63
Show file tree
Hide file tree
Showing 103 changed files with 8,870 additions and 3,067 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/check-same-code-base.yml
Expand Up @@ -16,27 +16,32 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["8.0"]
php-versions: ["8.1"]

name: check-same-code-base

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i

- name: check-same-code-base
run: make check-same-code-base

- name: check-updater-phar
run: |
make box
./box info -l updater.phar | grep -v "^Signature Hash" | grep -v "^ Version.php " | grep -v "^Contents: " >updater.old.txt
./vendor/bin/box info -l updater.phar | grep -v "^Signature Hash" | grep -v "^ Version.php " | grep -v "^Contents: " | grep -v "^ installed.php " > updater.old.txt
make updater.phar
./box info -l updater.phar | grep -v "^Signature Hash" | grep -v "^ Version.php " | grep -v "^Contents: " >updater.txt
./vendor/bin/box info -l updater.phar | grep -v "^Signature Hash" | grep -v "^ Version.php " | grep -v "^Contents: " | grep -v "^ installed.php " > updater.txt
diff updater.txt updater.old.txt
25 changes: 13 additions & 12 deletions .github/workflows/lint-php-cs.yml
Expand Up @@ -3,19 +3,17 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint
name: Lint php-cs

on:
pull_request:
push:
branches:
- main
- 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:
runs-on: ubuntu-latest
Expand All @@ -24,13 +22,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
- name: Set up php
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: "7.4"
php-version: 8.1
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/lint-php.yml
Expand Up @@ -3,7 +3,7 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint
name: Lint php

on:
pull_request:
Expand All @@ -16,24 +16,31 @@ on:
permissions:
contents: read

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

jobs:
php-lint:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["7.4", "8.0", "8.1"]
php-versions: [ "8.0", "8.1", "8.2" ]

name: php-lint

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Lint
run: composer run lint
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/psalm.yml
@@ -1,30 +1,39 @@
# 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: Static analysis

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

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

jobs:
static-psalm-analysis:
static-analysis:
runs-on: ubuntu-latest

strategy:
matrix:
ocp-version: [ 'dev-master' ]

name: Nextcloud ${{ matrix.ocp-version }}
name: Nextcloud
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: 7.4
php-version: 8.1
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-cli.yml
Expand Up @@ -12,11 +12,11 @@ permissions:
contents: read

jobs:
php-lint:
test-cli:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["7.4"]
php-versions: ["8.1"]

name: test-cli

Expand All @@ -28,7 +28,12 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: apcu,ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
ini-file: development

- name: Install dependencies
run: composer i

- name: test-cli
run: make test-cli
11 changes: 8 additions & 3 deletions .github/workflows/test-master.yml
Expand Up @@ -16,19 +16,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["7.4", "8.0", "8.1"]
php-versions: [k"8.0", "8.1", "8.2"]

name: test-master

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: ${{ matrix.php-versions }}
extensions: apcu,ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
ini-file: development

- name: Install dependencies
run: composer i

- name: test-master
run: make test-master
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test-stable.yml
Expand Up @@ -16,25 +16,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["7.4", "8.0"]
nextcloud-versions: ["19", "20", "21"]
exclude:
- php-versions: "8.0"
nextcloud-versions: "19"
- php-versions: "8.0"
nextcloud-versions: "20"
php-versions: ["7.4", "8.0", "8.1"]
nextcloud-versions: ["25"]

name: test-stable

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: ${{ matrix.php-versions }}
extensions: apcu,ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none
ini-file: development

- name: Install dependencies
run: composer i

- name: test-stable${{ matrix.nextcloud-versions }}
run: make test-stable${{ matrix.nextcloud-versions }}
Expand Down
14 changes: 8 additions & 6 deletions .gitignore
@@ -1,8 +1,10 @@
box
lib/Version.php
tests/data
tests/vendor
vendor/symfony/console/Tests
vendor/symfony/debug/Tests
/box
/lib/Version.php
/tests/data
/tests/vendor
/vendor/bamarni/composer-bin-plugin/e2e
/vendor/bin
/vendor/symfony/console/Tests
/vendor/symfony/debug/Tests
/vendor-bin/**/vendor
.php-cs-fixer.cache
20 changes: 8 additions & 12 deletions Makefile
@@ -1,13 +1,9 @@
.PHONY: updater.phar

box:
curl -L https://github.com/box-project/box/releases/download/3.11.1/box.phar -o box
chmod +x box

updater.phar: box updater.php lib/*.php buildVersionFile.php
updater.phar: updater.php lib/*.php buildVersionFile.php
php buildVersionFile.php
composer dump-autoload
./box compile -c box.json
composer run box
chmod +x updater.phar
rm lib/Version.php

Expand All @@ -29,14 +25,14 @@ test: updater.phar test/vendor
test-cli: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/cli.feature

test-stable19: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable19.feature
test-stable24: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable24.feature

test-stable20: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable20.feature
test-stable25: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable25.feature

test-stable21: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable21.feature
test-stable26: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/stable26.feature

test-master: updater.phar test/vendor
cd tests && vendor/behat/behat/bin/behat features/master.feature
Expand Down
21 changes: 14 additions & 7 deletions composer.json
Expand Up @@ -11,24 +11,31 @@
"classmap-authoritative": true,
"optimize-autoloader": true,
"platform": {
"php": "7.4"
"php": "8.0"
},
"sort-packages": true
},
"require": {
"symfony/console": "^4.4"
},
"scripts": {
"box": "box compile -c box.json",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor*' -not -path './build/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l",
"post-install-cmd": ["@composer bin all install --ansi"],
"post-update-cmd": ["@composer bin all update --ansi"],
"psalm": "psalm",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm:update-baseline": "psalm --threads=1 --update-baseline"
"psalm": "psalm --threads=$(nproc)",
"psalm:ci": "psalm --threads=1",
"psalm:fix": "- --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.5"
"bamarni/composer-bin-plugin": "^1.8",
"nextcloud/coding-standard": "^1.1"
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"target-directory": "vendor-bin",
"forward-command": true
}
}
}

0 comments on commit 7f59f63

Please sign in to comment.