From 09836567bc8ad1e8478472ad539c6ea05d2b30b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Thu, 1 Jun 2023 18:24:25 +0200 Subject: [PATCH] chore: update workflows from templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .github/workflows/block-merge-freeze.yml | 23 ++++++++----- .github/workflows/command-compile.yml | 22 ++++++------ .github/workflows/command-rebase.yml | 8 ++--- .github/workflows/fixup.yml | 6 ++-- .../workflows/lint-eslint-when-unrelated.yml | 2 +- .github/workflows/lint-eslint.yml | 8 ++--- .github/workflows/lint-php-cs.yml | 7 ++-- .github/workflows/lint-php.yml | 7 ++-- .github/workflows/lint-stylelint.yml | 8 ++--- .github/workflows/node.yml | 6 ++-- .github/workflows/npm-audit-fix.yml | 12 +++---- .github/workflows/phpunit-mysql.yml | 23 ++++++++----- .github/workflows/phpunit-oci.yml | 34 +++++++++++++++---- .github/workflows/phpunit-pgsql.yml | 21 ++++++++---- .github/workflows/phpunit-sqlite.yml | 19 +++++++---- .../phpunit-summary-when-unrelated.yml | 2 +- .github/workflows/psalm.yml | 5 +-- .github/workflows/update-nextcloud-ocp.yml | 31 ++++++++++++----- 18 files changed, 156 insertions(+), 88 deletions(-) diff --git a/.github/workflows/block-merge-freeze.yml b/.github/workflows/block-merge-freeze.yml index 9531cde798..f2d029c992 100644 --- a/.github/workflows/block-merge-freeze.yml +++ b/.github/workflows/block-merge-freeze.yml @@ -3,23 +3,30 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: Pull request checks +name: Block merges during freezes -on: pull_request +on: + pull_request: + types: [opened, ready_for_review, reopened, synchronize] + +permissions: + contents: read + +concurrency: + group: block-merge-freeze-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: block-merges-during-freeze: name: Block merges during freezes + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest steps: - - name: Register text Git reference - run: | - server_ref="$(if [ "${{ github.base_ref }}" = "main" ]; then echo -n "master"; else echo -n "${{ github.base_ref }}"; fi)" - echo "server_ref=$server_ref" >> $GITHUB_ENV - - name: Download version.php from ${{ env.server_ref }} - run: curl https://raw.githubusercontent.com/nextcloud/server/${{ env.server_ref }}/version.php --output version.php + - name: Download version.php from ${{ github.base_ref }} + run: curl https://raw.githubusercontent.com/nextcloud/server/${{ github.base_ref }}/version.php --output version.php - name: Run check run: cat version.php | grep 'OC_VersionString' | grep -i -v 'RC' diff --git a/.github/workflows/command-compile.yml b/.github/workflows/command-compile.yml index ea093b5166..a1255cffc8 100644 --- a/.github/workflows/command-compile.yml +++ b/.github/workflows/command-compile.yml @@ -18,20 +18,20 @@ jobs: steps: - name: Check actor permission - uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1 + uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2 with: require: write - name: Add reaction on start - uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 # v2.1.0 + uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1 with: token: ${{ secrets.COMMAND_BOT_PAT }} repository: ${{ github.event.repository.full_name }} comment-id: ${{ github.event.comment.id }} - reaction-type: "+1" + reactions: "+1" - name: Parse command - uses: skjnldsv/parse-command-comment@e9cb9d1df338afed4295a59bbe27b4da53fd38a8 # master + uses: skjnldsv/parse-command-comment@7cef1df370a99dfd5bf896d50121390c96785db8 # v2 id: command # Init path depending on which command is run @@ -45,7 +45,7 @@ jobs: fi - name: Init branch - uses: xt0rted/pull-request-comment-branch@653a7d5ca8bd91d3c5cb83286063314d0b063b8e # v1 + uses: xt0rted/pull-request-comment-branch@d97294d304604fa98a2600a6e2f916a84b596dc7 # v1 id: comment-branch process: @@ -54,7 +54,7 @@ jobs: steps: - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: token: ${{ secrets.COMMAND_BOT_PAT }} fetch-depth: 0 @@ -66,14 +66,14 @@ jobs: git config --local user.name "nextcloud-command" - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2 + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 id: package-engines-versions with: fallbackNode: '^16' fallbackNpm: '^7' - name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }} - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }} cache: npm @@ -90,7 +90,7 @@ jobs: if: ${{ needs.init.outputs.arg1 != 'fixup' && needs.init.outputs.arg1 != 'amend' }} run: | git add ${{ needs.init.outputs.git_path }} - git commit --signoff -m 'Compile assets' + git commit --signoff -m 'chore(assets): Recompile assets' git push origin ${{ needs.init.outputs.head_ref }} - name: Commit and push fixup @@ -108,10 +108,10 @@ jobs: git push --force origin ${{ needs.init.outputs.head_ref }} - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 # v2.1.0 + uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1 if: failure() with: token: ${{ secrets.COMMAND_BOT_PAT }} repository: ${{ github.event.repository.full_name }} comment-id: ${{ github.event.comment.id }} - reaction-type: "-1" + reactions: "-1" diff --git a/.github/workflows/command-rebase.yml b/.github/workflows/command-rebase.yml index 1b388439bd..ec95ccbbf4 100644 --- a/.github/workflows/command-rebase.yml +++ b/.github/workflows/command-rebase.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Add reaction on start - uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 # v2.1.0 + uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1 with: token: ${{ secrets.COMMAND_BOT_PAT }} repository: ${{ github.event.repository.full_name }} @@ -31,18 +31,18 @@ jobs: reaction-type: "+1" - name: Checkout the latest code - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: fetch-depth: 0 token: ${{ secrets.COMMAND_BOT_PAT }} - name: Automatic Rebase - uses: cirrus-actions/rebase@6e572f08c244e2f04f9beb85a943eb618218714d # 1.7 + uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691 # 1.8 env: GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 # v2.1.0 + uses: peter-evans/create-or-update-comment@ca08ebd5dc95aa0cd97021e9708fcd6b87138c9b # v3.0.1 if: failure() with: token: ${{ secrets.COMMAND_BOT_PAT }} diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml index b9e3920789..9548d19f2d 100644 --- a/.github/workflows/fixup.yml +++ b/.github/workflows/fixup.yml @@ -3,11 +3,11 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: Pull request checks +name: Block fixup and squash commits on: pull_request: - types: [opened, ready_for_review, reopened] + types: [opened, ready_for_review, reopened, synchronize] permissions: contents: read @@ -28,6 +28,6 @@ jobs: steps: - name: Run check - uses: xt0rted/block-autosquash-commits-action@79880c36b4811fe549cfffe20233df88876024e7 # v2 + uses: skjnldsv/block-fixup-merge-action@42d26e1b536ce61e5cf467d65fb76caf4aa85acf # v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-eslint-when-unrelated.yml b/.github/workflows/lint-eslint-when-unrelated.yml index 63710eb665..7a2e9f0581 100644 --- a/.github/workflows/lint-eslint-when-unrelated.yml +++ b/.github/workflows/lint-eslint-when-unrelated.yml @@ -6,7 +6,7 @@ # Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions # 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 -name: Lint +name: Lint eslint on: pull_request: diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index 628e8fefa9..508d713953 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -6,7 +6,7 @@ # Use lint-eslint together with lint-eslint-when-unrelated to make eslint a required check for GitHub actions # 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 -name: Lint +name: Lint eslint on: pull_request: @@ -38,17 +38,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2 + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 id: versions with: fallbackNode: '^16' fallbackNpm: '^7' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml index df490fb23b..f8d3375111 100644 --- a/.github/workflows/lint-php-cs.yml +++ b/.github/workflows/lint-php-cs.yml @@ -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-cs on: pull_request @@ -22,13 +22,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up php - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: 8.1 coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index 45bf08292a..8d7f63f84b 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -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: @@ -31,13 +31,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: ${{ matrix.php-versions }} coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml index 6cdf20cc9c..60cb63a560 100644 --- a/.github/workflows/lint-stylelint.yml +++ b/.github/workflows/lint-stylelint.yml @@ -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 stylelint on: pull_request @@ -22,17 +22,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2 + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 id: versions with: fallbackNode: '^16' fallbackNpm: '^7' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index e3310644ec..1774e0b271 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -37,17 +37,17 @@ jobs: name: node steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2 + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 id: versions with: fallbackNode: '^16' fallbackNpm: '^7' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/npm-audit-fix.yml b/.github/workflows/npm-audit-fix.yml index dededbc97f..5fa7f69e5b 100644 --- a/.github/workflows/npm-audit-fix.yml +++ b/.github/workflows/npm-audit-fix.yml @@ -3,7 +3,7 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: npm audit fix and compile +name: Npm audit fix and compile on: workflow_dispatch: @@ -18,25 +18,25 @@ jobs: strategy: fail-fast: false matrix: - branches: ["main", "master", "stable26", "stable25", "stable24"] + branches: ["main", "master", "stable27", "stable26", "stable25", "stable24"] name: npm-audit-fix-${{ matrix.branches }} steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ matrix.branches }} - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2 + uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 id: versions with: fallbackNode: '^16' fallbackNpm: '^7' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 with: node-version: ${{ steps.versions.outputs.nodeVersion }} @@ -55,7 +55,7 @@ jobs: - name: Create Pull Request if: always() - uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3 + uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v5 with: token: ${{ secrets.COMMAND_BOT_PAT }} commit-message: "chore(deps): fix npm audit" diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml index bf3aaa5c56..33799c8747 100644 --- a/.github/workflows/phpunit-mysql.yml +++ b/.github/workflows/phpunit-mysql.yml @@ -3,7 +3,7 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: PHPUnit +name: PHPUnit mysql on: pull_request: @@ -38,12 +38,12 @@ jobs: strategy: matrix: - php-versions: ['8.0', '8.1'] + php-versions: ['8.0', '8.1', '8.2'] server-versions: ['master'] services: mysql: - image: mariadb:10.5 + image: ghcr.io/nextcloud/continuous-integration-mariadb-10.6:latest ports: - 4444:3306/tcp env: @@ -62,23 +62,25 @@ jobs: echo "SELECT @@sql_mode;" | mysql -h 127.0.0.1 -P 4444 -u root -prootpassword - name: Checkout server - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: submodules: true repository: nextcloud/server ref: ${{ matrix.server-versions }} - name: Checkout app - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql + # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -99,7 +101,7 @@ jobs: DB_PORT: 4444 run: | 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 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 admin ./occ app:enable --force ${{ env.APP_NAME }} - name: Check PHPUnit script is defined @@ -133,6 +135,11 @@ jobs: working-directory: apps/${{ env.APP_NAME }} run: composer run test:integration + - name: Print logs + if: always() + run: | + cat data/nextcloud.log + - name: Skipped # Fail the action when neither unit nor integration tests ran if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' diff --git a/.github/workflows/phpunit-oci.yml b/.github/workflows/phpunit-oci.yml index 930d2c2435..9b6d693b29 100644 --- a/.github/workflows/phpunit-oci.yml +++ b/.github/workflows/phpunit-oci.yml @@ -3,7 +3,7 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: PHPUnit +name: PHPUnit OCI on: pull_request: @@ -43,10 +43,25 @@ jobs: services: oracle: - image: deepdiver/docker-oracle-xe-11g # 'wnameless/oracle-xe-11g-r2' + image: ghcr.io/gvenzl/oracle-xe:11 + + # Provide passwords and other environment variables to container + env: + ORACLE_RANDOM_PASSWORD: true + APP_USER: autotest + APP_USER_PASSWORD: owncloud + + # Forward Oracle port ports: - 1521:1521/tcp + # Provide healthcheck script options for startup + options: >- + --health-cmd healthcheck.sh + --health-interval 10s + --health-timeout 5s + --health-retries 10 + steps: - name: Set app env run: | @@ -54,23 +69,25 @@ jobs: echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - name: Checkout server - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: submodules: true repository: nextcloud/server ref: ${{ matrix.server-versions }} - name: Checkout app - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, oci8 + # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8 coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -125,6 +142,11 @@ jobs: working-directory: apps/${{ env.APP_NAME }} run: composer run test:integration + - name: Print logs + if: always() + run: | + cat data/nextcloud.log + - name: Skipped # Fail the action when neither unit nor integration tests ran if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' diff --git a/.github/workflows/phpunit-pgsql.yml b/.github/workflows/phpunit-pgsql.yml index 8ec26389d5..5e66fd2c43 100644 --- a/.github/workflows/phpunit-pgsql.yml +++ b/.github/workflows/phpunit-pgsql.yml @@ -3,7 +3,7 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: PHPUnit +name: PHPUnit pgsql on: pull_request: @@ -43,7 +43,7 @@ jobs: services: postgres: - image: postgres:14 + image: ghcr.io/nextcloud/continuous-integration-postgres-14:latest ports: - 4444:5432/tcp env: @@ -59,23 +59,25 @@ jobs: echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - name: Checkout server - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: submodules: true repository: nextcloud/server ref: ${{ matrix.server-versions }} - name: Checkout app - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, iconv, fileinfo, intl, pgsql, pdo_pgsql + # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -96,7 +98,7 @@ jobs: DB_PORT: 4444 run: | mkdir data - ./occ maintenance:install --verbose --database=pgsql --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 maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin ./occ app:enable --force ${{ env.APP_NAME }} - name: Check PHPUnit script is defined @@ -130,6 +132,11 @@ jobs: working-directory: apps/${{ env.APP_NAME }} run: composer run test:integration + - name: Print logs + if: always() + run: | + cat data/nextcloud.log + - name: Skipped # Fail the action when neither unit nor integration tests ran if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml index f1e432afbf..d613117fa9 100644 --- a/.github/workflows/phpunit-sqlite.yml +++ b/.github/workflows/phpunit-sqlite.yml @@ -3,7 +3,7 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: PHPUnit +name: PHPUnit sqlite on: pull_request: @@ -48,23 +48,25 @@ jobs: echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - name: Checkout server - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: submodules: true repository: nextcloud/server ref: ${{ matrix.server-versions }} - name: Checkout app - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: path: apps/${{ env.APP_NAME }} - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: ${{ matrix.php-versions }} - extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite + # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -85,7 +87,7 @@ jobs: DB_PORT: 4444 run: | mkdir data - ./occ maintenance:install --verbose --database=sqlite --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 maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin ./occ app:enable --force ${{ env.APP_NAME }} - name: Check PHPUnit script is defined @@ -119,6 +121,11 @@ jobs: working-directory: apps/${{ env.APP_NAME }} run: composer run test:integration + - name: Print logs + if: always() + run: | + cat data/nextcloud.log + - name: Skipped # Fail the action when neither unit nor integration tests ran if: steps.check_phpunit.outcome == 'failure' && steps.check_integration.outcome == 'failure' diff --git a/.github/workflows/phpunit-summary-when-unrelated.yml b/.github/workflows/phpunit-summary-when-unrelated.yml index 53ca3096b7..484fdbb5bb 100644 --- a/.github/workflows/phpunit-summary-when-unrelated.yml +++ b/.github/workflows/phpunit-summary-when-unrelated.yml @@ -3,7 +3,7 @@ # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -name: PHPUnit +name: PHPUnit summary on: pull_request: diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 15cab7e300..7be48f2618 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -24,13 +24,14 @@ jobs: name: Nextcloud steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up php - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: 8.1 coverage: none + ini-file: development env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-nextcloud-ocp.yml b/.github/workflows/update-nextcloud-ocp.yml index 605459b396..e40744d3f4 100644 --- a/.github/workflows/update-nextcloud-ocp.yml +++ b/.github/workflows/update-nextcloud-ocp.yml @@ -17,21 +17,22 @@ jobs: strategy: fail-fast: false matrix: - branches: ["main", "stable27", "stable26", "stable25", "stable24"] + branches: ["main", "master", "stable27", "stable26", "stable25"] name: update-nextcloud-ocp-${{ matrix.branches }} steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: ref: ${{ matrix.branches }} submodules: true - name: Set up php8.1 - uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2 + uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 with: php-version: 8.1 - extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip + # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -40,19 +41,33 @@ jobs: run: composer install - name: Composer update nextcloud/ocp + if: matrix.branches != 'main' run: composer require --dev nextcloud/ocp:dev-${{ matrix.branches }} - continue-on-error: true - - name: Reset checkout dirs + - name: Composer update nextcloud/ocp + if: matrix.branches == 'main' + run: composer require --dev nextcloud/ocp:dev-master + + - name: Reset checkout 3rdparty run: | git clean -f 3rdparty + git checkout 3rdparty + continue-on-error: true + + - name: Reset checkout vendor + run: | git clean -f vendor + git checkout vendor + continue-on-error: true + + - name: Reset checkout vendor-bin + run: | git clean -f vendor-bin - git checkout 3rdparty vendor vendor-bin + git checkout vendor-bin continue-on-error: true - name: Create Pull Request - uses: peter-evans/create-pull-request@18f7dc018cc2cd597073088f7c7591b9d1c02672 # v3 + uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666 # v3 with: token: ${{ secrets.COMMAND_BOT_PAT }} commit-message: "chore(dev-deps): Bump nextcloud/ocp package"