diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml deleted file mode 100644 index cb3024d9fb9..00000000000 --- a/.github/workflows/appstore-build-publish.yml +++ /dev/null @@ -1,191 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Build and publish app release - -on: - release: - types: [published] - -permissions: - contents: write - -jobs: - build_and_publish: - runs-on: ubuntu-latest - - # Only allowed to be run on nextcloud-releases repositories - if: ${{ github.repository_owner == 'nextcloud-releases' }} - - steps: - - name: Check actor permission - uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0 - with: - require: write - - - name: Set app env - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: ${{ env.APP_NAME }} - - - name: Get app version number - id: app-version - uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0 - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - expression: "//info//version/text()" - - - name: Validate app version against tag - run: | - [ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ] - - - name: Get appinfo data - id: appinfo - uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0 - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - expression: "//info//dependencies//nextcloud/@min-version" - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - # Continue if no package.json - continue-on-error: true - with: - path: ${{ env.APP_NAME }} - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - # Skip if no package.json - if: ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - # Skip if no package.json - if: ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - - name: Get php version - id: php-versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - with: - filename: ${{ env.APP_NAME }}/appinfo/info.xml - - - name: Set up php ${{ steps.php-versions.outputs.php-min }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ steps.php-versions.outputs.php-min }} - coverage: none - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check composer.json - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "${{ env.APP_NAME }}/composer.json" - - - name: Install composer dependencies - if: steps.check_composer.outputs.files_exists == 'true' - run: | - cd ${{ env.APP_NAME }} - composer install --no-dev - - - name: Build ${{ env.APP_NAME }} - # Skip if no package.json - if: ${{ steps.versions.outputs.nodeVersion }} - env: - CYPRESS_INSTALL_BINARY: 0 - run: | - cd ${{ env.APP_NAME }} - npm ci - npm run build --if-present - - - name: Check Krankerl config - id: krankerl - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: ${{ env.APP_NAME }}/krankerl.toml - - - name: Install Krankerl - if: steps.krankerl.outputs.files_exists == 'true' - run: | - wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb - sudo dpkg -i krankerl_0.14.0_amd64.deb - - - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl - if: steps.krankerl.outputs.files_exists == 'true' - run: | - cd ${{ env.APP_NAME }} - krankerl package - - - name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile - if: steps.krankerl.outputs.files_exists != 'true' - run: | - cd ${{ env.APP_NAME }} - make appstore - - - name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} - continue-on-error: true - id: server-checkout - run: | - NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}' - wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip - unzip latest-$NCVERSION.zip - - - name: Checkout server master fallback - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - if: ${{ steps.server-checkout.outcome != 'success' }} - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - path: nextcloud - - - name: Sign app - run: | - # Extracting release - cd ${{ env.APP_NAME }}/build/artifacts - tar -xvf ${{ env.APP_NAME }}.tar.gz - cd ../../../ - # Setting up keys - echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key - wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt" - # Signing - php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }} - # Rebuilding archive - cd ${{ env.APP_NAME }}/build/artifacts - tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }} - - - name: Attach tarball to github release - uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2 - id: attach_to_release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz - asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz - tag: ${{ github.ref }} - overwrite: true - - - name: Upload app to Nextcloud appstore - uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1.0.3 - with: - app_name: ${{ env.APP_NAME }} - appstore_token: ${{ secrets.APPSTORE_TOKEN }} - download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} - app_private_key: ${{ secrets.APP_PRIVATE_KEY }} diff --git a/.github/workflows/block-unconventional-commits.yml b/.github/workflows/block-unconventional-commits.yml deleted file mode 100644 index 69adb894ff3..00000000000 --- a/.github/workflows/block-unconventional-commits.yml +++ /dev/null @@ -1,36 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Block unconventional commits - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: block-unconventional-commits-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - block-unconventional-commits: - name: Block unconventional commits - - runs-on: ubuntu-latest-low - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - uses: webiny/action-conventional-commits@8bc41ff4e7d423d56fa4905f6ff79209a78776c7 # v1.3.0 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/command-openapi.yml b/.github/workflows/command-openapi.yml deleted file mode 100644 index f4732d2c02a..00000000000 --- a/.github/workflows/command-openapi.yml +++ /dev/null @@ -1,199 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: OpenAPI Command -on: - issue_comment: - types: [created] - -permissions: - contents: read - -jobs: - init: - runs-on: ubuntu-latest - - # On pull requests and if the comment starts with `/openapi` - if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/openapi') - - outputs: - git_path: ${{ steps.git-path.outputs.path }} - arg1: ${{ steps.command.outputs.arg1 }} - arg2: ${{ steps.command.outputs.arg2 }} - head_ref: ${{ steps.comment-branch.outputs.head_ref }} - base_ref: ${{ steps.comment-branch.outputs.base_ref }} - - steps: - - name: Get repository from pull request comment - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - id: get-repository - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const pull = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - const repositoryName = pull.data.head?.repo?.full_name - console.log(repositoryName) - return repositoryName - - - name: Disabled on forks - if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }} - run: | - echo 'Can not execute /openapi on forks' - exit 1 - - - name: Check actor permission - uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2 - with: - require: write - - - name: Add reaction on start - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '+1' - - - name: Parse command - uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v2 - id: command - - # Init path depending on which command is run - - name: Init path - id: git-path - run: | - if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then - echo "path=${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT - else - echo "path=${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT - fi - - - name: Init branch - uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0 - id: comment-branch - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '-1' - - process: - runs-on: ubuntu-latest - needs: init - - steps: - - name: Restore cached git repository - uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 - with: - path: .git - key: git-repo - - - name: Checkout ${{ needs.init.outputs.head_ref }} - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - # Needed to allow force push later - persist-credentials: true - token: ${{ secrets.COMMAND_BOT_PAT }} - fetch-depth: 0 - ref: ${{ needs.init.outputs.head_ref }} - - - name: Setup git - run: | - git config --local user.email 'nextcloud-command@users.noreply.github.com' - git config --local user.name 'nextcloud-command' - - - name: Check Typescript OpenApi types - id: check_typescript_openapi - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "src/types/openapi/openapi*.ts" - - - name: Read package.json node and npm engines version - if: steps.check_typescript_openapi.outputs.files_exists == 'true' - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: node_versions - # Continue if no package.json - continue-on-error: true - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.node_versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' - - - name: Rebase to ${{ needs.init.outputs.base_ref }} - if: ${{ contains(needs.init.outputs.arg1, 'rebase') }} - run: | - git fetch origin '${{ needs.init.outputs.base_ref }}:${{ needs.init.outputs.base_ref }}' - git rebase 'origin/${{ needs.init.outputs.base_ref }}' - - - name: Install dependencies - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: | - npm ci - - - name: Set up dependencies - run: composer i - - - name: Regenerate OpenAPI - run: composer run openapi - - - name: Commit default - if: ${{ !contains(needs.init.outputs.arg1, 'fixup') && !contains(needs.init.outputs.arg1, 'amend') }} - run: | - git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}' - git commit --signoff -m 'fix(openapi): Regenerate OpenAPI assets' - - - name: Commit fixup - if: ${{ contains(needs.init.outputs.arg1, 'fixup') }} - run: | - git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}' - git commit --fixup=HEAD --signoff - - - name: Commit amend - if: ${{ contains(needs.init.outputs.arg1, 'amend') }} - run: | - git add '${{ github.workspace }}${{ needs.init.outputs.git_path }}' - git commit --amend --no-edit --signoff - # Remove any [skip ci] from the amended commit - git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')" - - - name: Push normally - if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }} - run: git push origin '${{ needs.init.outputs.head_ref }}' - - - name: Force push - if: ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }} - run: git push --force-with-lease origin '${{ needs.init.outputs.head_ref }}' - - - name: Add reaction on failure - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: failure() - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - repository: ${{ github.event.repository.full_name }} - comment-id: ${{ github.event.comment.id }} - reactions: '-1' diff --git a/.github/workflows/dependabot-approve-merge.yml b/.github/workflows/dependabot-approve-merge.yml deleted file mode 100644 index 6dc05867d51..00000000000 --- a/.github/workflows/dependabot-approve-merge.yml +++ /dev/null @@ -1,56 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Dependabot - -on: - pull_request_target: # zizmor: ignore[dangerous-triggers] - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: dependabot-approve-merge-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - auto-approve-merge: - if: github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'renovate[bot]' - runs-on: ubuntu-latest-low - permissions: - # for hmarr/auto-approve-action to approve PRs - pull-requests: write - - steps: - - name: Disabled on forks - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - run: | - echo 'Can not approve PRs from forks' - exit 1 - - - uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0 - id: branchname - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - # GitHub actions bot approve - - uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2 - if: contains(steps.branchname.outputs.branch, '/webrtc-adapter-') != true && contains(steps.branchname.outputs.branch, '/nextcloud/vue-') != true - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Nextcloud bot approve and merge request - - uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2 - if: contains(steps.branchname.outputs.branch, '/webrtc-adapter-') != true && contains(steps.branchname.outputs.branch, '/nextcloud/vue-') != true - with: - target: minor - github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }} diff --git a/.github/workflows/fixup.yml b/.github/workflows/fixup.yml deleted file mode 100644 index 69da2bbb039..00000000000 --- a/.github/workflows/fixup.yml +++ /dev/null @@ -1,36 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Block fixup and squash commits - -on: - pull_request: - types: [opened, ready_for_review, reopened, synchronize] - -permissions: - contents: read - -concurrency: - group: fixup-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - commit-message-check: - if: github.event.pull_request.draft == false - - permissions: - pull-requests: write - name: Block fixup and squash commits - - runs-on: ubuntu-latest-low - - steps: - - name: Run check - uses: skjnldsv/block-fixup-merge-action@c138ea99e45e186567b64cf065ce90f7158c236a # v2 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/integration-federation.yml b/.github/workflows/integration-federation.yml deleted file mode 100644 index 4231aecd633..00000000000 --- a/.github/workflows/integration-federation.yml +++ /dev/null @@ -1,354 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Integration Federation - -on: - pull_request: - schedule: - - cron: "5 2 * * *" - -permissions: - contents: read - -concurrency: - group: integration-federation-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/integration/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - integration-federation: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - name: Federation ${{ matrix.host-server-versions }} (${{ matrix.host-db }}) -> ${{ matrix.remote-server-versions }} (${{ matrix.remote-db }}) - - strategy: - fail-fast: false - matrix: - include: - - test-suite: 'federation' - php-versions: '8.2' - host-db: 'oci' - host-server-versions: 'master' - host-spreed-versions: ${{ github.event.pull_request.head.sha }} - host-guests-versions: 'main' - host-circles-versions: 'master' - host-notifications-versions: 'master' - remote-db: 'mysql' - remote-server-versions: 'stable32' - remote-spreed-versions: 'stable32' - remote-guests-versions: 'main' - remote-circles-versions: 'stable32' - remote-notifications-versions: 'stable32' - - test-suite: 'federation' - php-versions: '8.2' - host-db: 'pgsql' - host-server-versions: 'master' - host-spreed-versions: ${{ github.event.pull_request.head.sha }} - host-guests-versions: 'main' - host-circles-versions: 'master' - host-notifications-versions: 'master' - remote-db: 'mysql' - remote-server-versions: 'stable32' - remote-spreed-versions: 'stable32' - remote-guests-versions: 'main' - remote-circles-versions: 'stable32' - remote-notifications-versions: 'stable32' - - test-suite: 'federation' - php-versions: '8.2' - host-db: 'oci' - host-server-versions: 'stable32' - host-spreed-versions: 'stable32' - host-guests-versions: 'main' - host-circles-versions: 'stable32' - host-notifications-versions: 'stable32' - remote-db: 'mysql' - remote-server-versions: 'master' - remote-spreed-versions: ${{ github.event.pull_request.head.sha }} - remote-guests-versions: 'main' - remote-circles-versions: 'master' - remote-notifications-versions: 'master' - - services: - oracle: - 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 - - mysql: - image: ghcr.io/nextcloud/continuous-integration-mysql-8.4:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:3306/tcp - env: - MYSQL_ROOT_PASSWORD: rootpassword - options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10 - - postgres: - image: ghcr.io/nextcloud/continuous-integration-postgres-16:latest # zizmor: ignore[unpinned-images] - ports: - - 4445:5432/tcp - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: rootpassword - POSTGRES_DB: nextcloud - options: --health-cmd pg_isready --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: Checkout server - Host - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: host - submodules: true - repository: nextcloud/server - ref: ${{ matrix.host-server-versions }} - - - name: Checkout spreed app - Host - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: host/apps/spreed - ref: ${{ matrix.host-spreed-versions }} - - - name: Checkout circles app - Host - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: host/apps/circles - ref: ${{ matrix.host-circles-versions }} - - - name: Checkout guests app - Host - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: host/apps/guests - ref: ${{ matrix.host-guests-versions }} - - - name: Checkout notifications app - Host - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/notifications - path: host/apps/notifications - ref: ${{ matrix.host-notifications-versions }} - - - name: Checkout server - Remote - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: remote - submodules: true - repository: nextcloud/server - ref: ${{ matrix.remote-server-versions }} - - - name: Checkout spreed app - Remote - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: remote/apps/spreed - ref: ${{ matrix.remote-spreed-versions }} - - - name: Checkout circles app - Remote - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: remote/apps/circles - ref: ${{ matrix.remote-circles-versions }} - - - name: Checkout guests app - Remote - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: remote/apps/guests - ref: ${{ matrix.remote-guests-versions }} - - - name: Checkout notifications app - Remote - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/notifications - path: remote/apps/notifications - ref: ${{ matrix.remote-notifications-versions }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql, oci8, sqlite, pdo_sqlite - coverage: none - ini-file: development - # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on - ini-values: apc.enable_cli=on, disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up production dependencies - Host - working-directory: host/apps/${{ env.APP_NAME }} - run: composer i --no-dev - - - name: Set up production dependencies - Remote - working-directory: remote/apps/${{ env.APP_NAME }} - run: composer i --no-dev - - - name: Set up behat dependencies - working-directory: host/apps/${{ env.APP_NAME }}/tests/integration - run: composer i - - - name: Set up Nextcloud - Host (Postgres) - if: ${{ matrix.host-db == 'pgsql' }} - env: - DB_PORT: 4445 - working-directory: host/ - 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 admin - - - name: Set up Nextcloud - Host (Oracle) - if: ${{ matrix.host-db == 'oci' }} - env: - DB_PORT: 1521 - working-directory: host/ - run: | - mkdir data - ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin - - - name: Set up Nextcloud - Host (MySQL) - if: ${{ matrix.host-db == 'mysql' }} - env: - DB_PORT: 4444 - working-directory: host/ - 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 admin - - - name: Set up Nextcloud - Remote (Postgres) - if: ${{ matrix.remote-db == 'pgsql' }} - env: - DB_PORT: 4445 - working-directory: remote/ - 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 admin - - - name: Set up Nextcloud - Remote (Oracle) - if: ${{ matrix.remote-db == 'oracle' }} - env: - DB_PORT: 1521 - working-directory: remote/ - run: | - mkdir data - ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin - - - name: Set up Nextcloud - Remote (MySQL) - if: ${{ matrix.remote-db == 'mysql' }} - env: - DB_PORT: 4444 - working-directory: remote/ - 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 admin - - - name: Set up Nextcloud - Host (Shared) - working-directory: host/ - run: | - ./occ config:system:set debug --value=true --type=boolean - ./occ config:system:set hashing_default_password --value=true --type=boolean - ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" - ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests - ./occ app:enable --force notifications - - - name: Set up Nextcloud - Remote (Shared) - working-directory: remote/ - run: | - ./occ config:system:set debug --value=true --type=boolean - ./occ config:system:set hashing_default_password --value=true --type=boolean - ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" - ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests - ./occ app:enable --force notifications - echo 'REMOTE_ROOT_DIR='$PWD >> $GITHUB_ENV - - - name: Run integration - working-directory: host/apps/${{ env.APP_NAME }}/tests/integration - run: REMOTE_ROOT_DIR=${{ env.REMOTE_ROOT_DIR }} bash run.sh features/${{ matrix.test-suite }} - - - name: Print logs - Host - if: always() - working-directory: host/ - run: | - cat data/nextcloud.log - - - name: Print logs - Remote - if: always() - working-directory: remote/ - run: | - cat data/nextcloud.log - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, integration-federation] - - if: always() - - name: integration-federation-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-federation.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/integration-mariadb.yml b/.github/workflows/integration-mariadb.yml deleted file mode 100644 index 365e57c6483..00000000000 --- a/.github/workflows/integration-mariadb.yml +++ /dev/null @@ -1,189 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Integration mariadb - -on: - pull_request: - paths: - # Only running on PR for this file to save CI time (otherwise pgsql only) - - '.github/workflows/integration-mariadb.yml' - schedule: - - cron: "5 2 * * *" - -permissions: - contents: read - -concurrency: - group: integration-mariadb-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/integration/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - integration-mariadb: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] - php-versions: ['8.2'] - server-versions: ['master'] - guests-versions: ['main'] - circles-versions: ['master'] - notifications-versions: ['master'] - - services: - mariadb: - image: ghcr.io/nextcloud/continuous-integration-mariadb-11.4:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:3306/tcp - env: - MARIADB_ROOT_PASSWORD: rootpassword - options: --health-cmd="mariadb-admin 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: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Checkout circles app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: apps/circles - ref: ${{ matrix.circles-versions }} - - - name: Checkout guests app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: apps/guests - ref: ${{ matrix.guests-versions }} - - - name: Checkout notifications app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/notifications - path: apps/notifications - ref: ${{ matrix.notifications-versions }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, mysql, pdo_mysql, sqlite, pdo_sqlite - coverage: none - ini-file: development - # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on - ini-values: apc.enable_cli=on, disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Enable ONLY_FULL_GROUP_BY MariaDB 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: Set up production dependencies - working-directory: apps/${{ env.APP_NAME }} - run: composer i --no-dev - - - name: Set up behat dependencies - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ config:system:set debug --value=true --type=boolean - ./occ config:system:set hashing_default_password --value=true --type=boolean - ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" - ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests - ./occ app:enable --force notifications - - - name: Run integration - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: bash run.sh features/${{ matrix.test-suite }} - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Check Federation log - if: always() - id: check_federation_log - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "data/tests-talk-real-federated-server/data/nextcloud.log" - - - name: Print federation logs - if: always() && steps.check_federation_log.outputs.files_exists == 'true' - run: | - cat data/tests-talk-real-federated-server/data/nextcloud.log - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, integration-mariadb] - - if: always() - - name: integration-mariadb-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-mariadb.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/integration-oci.yml b/.github/workflows/integration-oci.yml deleted file mode 100644 index 8d414ff13a0..00000000000 --- a/.github/workflows/integration-oci.yml +++ /dev/null @@ -1,196 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Integration oci - -on: - pull_request: - paths: - # Only running on PR for this file to save CI time (otherwise pgsql only) - - '.github/workflows/integration-oci.yml' - schedule: - - cron: "5 2 * * *" - -permissions: - contents: read - -concurrency: - group: integration-oci-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/integration/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - integration-oci: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] - php-versions: ['8.2'] - server-versions: ['master'] - guests-versions: ['main'] - circles-versions: ['master'] - notifications-versions: ['master'] - - services: - oracle: - 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: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Checkout circles app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: apps/circles - ref: ${{ matrix.circles-versions }} - - - name: Checkout guests app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: apps/guests - ref: ${{ matrix.guests-versions }} - - - name: Checkout notifications app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/notifications - path: apps/notifications - ref: ${{ matrix.notifications-versions }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8, sqlite, pdo_sqlite - coverage: none - ini-file: development - # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on - ini-values: apc.enable_cli=on, disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up production dependencies - working-directory: apps/${{ env.APP_NAME }} - run: composer i --no-dev - - - name: Set up behat dependencies - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: composer i - - - name: Set up Nextcloud - env: - DB_PORT: 1521 - run: | - mkdir data - ./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin - ./occ config:system:set debug --value=true --type=boolean - ./occ config:system:set hashing_default_password --value=true --type=boolean - ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" - ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests - ./occ app:enable --force notifications - - - name: Run integration - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: bash run.sh features/${{ matrix.test-suite }} - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Check Federation log - if: always() - id: check_federation_log - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "data/tests-talk-real-federated-server/data/nextcloud.log" - - - name: Print federation logs - if: always() && steps.check_federation_log.outputs.files_exists == 'true' - run: | - cat data/tests-talk-real-federated-server/data/nextcloud.log - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, integration-oci] - - if: always() - - name: integration-oci-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-oci.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/integration-pgsql.yml b/.github/workflows/integration-pgsql.yml deleted file mode 100644 index a064b16555c..00000000000 --- a/.github/workflows/integration-pgsql.yml +++ /dev/null @@ -1,216 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Integration pgsql - -on: - pull_request: - schedule: - - cron: "5 2 * * *" - -permissions: - contents: read - -concurrency: - group: integration-pgsql-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/integration/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - integration-pgsql: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - test-suite: - - 'callapi' - - 'chat-1' - - 'chat-2' - - 'chat-3' - - 'chat-4' - - 'command' - - 'conversation-1' - - 'conversation-2' - - 'conversation-3' - - 'conversation-4' - - 'conversation-5' - - 'federation' - - 'integration' - - 'scaling' - - 'sharing-1' - - 'sharing-2' - - 'sharing-3' - - 'sharing-4' - php-versions: ['8.3'] - server-versions: ['master'] - guests-versions: ['main'] - circles-versions: ['master'] - notifications-versions: ['master'] - - services: - postgres: - image: ghcr.io/nextcloud/continuous-integration-postgres-16:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:5432/tcp - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: rootpassword - POSTGRES_DB: nextcloud - options: --health-cmd pg_isready --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: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Patch version check for nightly PHP - if: ${{ matrix.php-versions == '8.4' }} - run: echo " lib/versioncheck.php - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Checkout circles app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: apps/circles - ref: ${{ matrix.circles-versions }} - - - name: Checkout guests app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: apps/guests - ref: ${{ matrix.guests-versions }} - - - name: Checkout notifications app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/notifications - path: apps/notifications - ref: ${{ matrix.notifications-versions }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql, sqlite, pdo_sqlite - coverage: none - ini-file: development - # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on - ini-values: apc.enable_cli=on, disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up production dependencies - working-directory: apps/${{ env.APP_NAME }} - run: composer i --no-dev - - - name: Set up behat dependencies - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ config:system:set debug --value=true --type=boolean - ./occ config:system:set hashing_default_password --value=true --type=boolean - ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" - ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests - ./occ app:enable --force notifications - - - name: Run integration - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: bash run.sh features/${{ matrix.test-suite }} - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Print query logs - if: matrix.test-suite == 'scaling' - run: | - cat data/query.log - - - name: Upload query.log - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: query-list.txt - path: data/query.log - - - name: Check Federation log - if: always() - id: check_federation_log - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "data/tests-talk-real-federated-server/data/nextcloud.log" - - - name: Print federation logs - if: always() && steps.check_federation_log.outputs.files_exists == 'true' - run: | - cat data/tests-talk-real-federated-server/data/nextcloud.log - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, integration-pgsql] - - if: always() - - name: integration-pgsql-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-pgsql.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/integration-sqlite.yml b/.github/workflows/integration-sqlite.yml deleted file mode 100644 index 631baea3f19..00000000000 --- a/.github/workflows/integration-sqlite.yml +++ /dev/null @@ -1,175 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Integration sqlite - -on: - pull_request: - paths: - # Only running on PR for this file to save CI time (otherwise pgsql only) - - '.github/workflows/integration-sqlite.yml' - schedule: - - cron: "5 2 * * *" - -permissions: - contents: read - -concurrency: - group: integration-sqlite-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/integration/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - integration-sqlite: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - strategy: - fail-fast: false - matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] - php-versions: ['8.2'] - server-versions: ['master'] - guests-versions: ['main'] - circles-versions: ['master'] - notifications-versions: ['master'] - - steps: - - name: Set app env - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Checkout circles app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: apps/circles - ref: ${{ matrix.circles-versions }} - - - name: Checkout guests app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: apps/guests - ref: ${{ matrix.guests-versions }} - - - name: Checkout notifications app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/notifications - path: apps/notifications - ref: ${{ matrix.notifications-versions }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation - extensions: apcu, 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 - # Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on - ini-values: apc.enable_cli=on, disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up production dependencies - working-directory: apps/${{ env.APP_NAME }} - run: composer i --no-dev - - - name: Set up behat dependencies - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ config:system:set debug --value=true --type=boolean - ./occ config:system:set hashing_default_password --value=true --type=boolean - ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" - ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" - ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests - ./occ app:enable --force notifications - - - name: Run integration - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: bash run.sh features/${{ matrix.test-suite }} - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log - - - name: Check Federation log - if: always() - id: check_federation_log - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "data/tests-talk-real-federated-server/data/nextcloud.log" - - - name: Print federation logs - if: always() && steps.check_federation_log.outputs.files_exists == 'true' - run: | - cat data/tests-talk-real-federated-server/data/nextcloud.log - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, integration-sqlite] - - if: always() - - name: integration-sqlite-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-sqlite.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml deleted file mode 100644 index 209b45f9c7a..00000000000 --- a/.github/workflows/lint-action.yml +++ /dev/null @@ -1,42 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Lint GitHub Actions - -on: - pull_request: - paths: - - '.github/workflows/**' - -permissions: - contents: read - -jobs: - action-lint: - runs-on: ubuntu-latest - - name: GitHub Actions lint - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: GitHub action templates lint - uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1 - with: - file_or_dir: .github/workflows - config_data: | - line-length: warning - - - name: Install the latest version of uv - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0 - - - name: Check GitHub actions - run: uvx zizmor --min-severity medium .github/workflows/*.yml diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml deleted file mode 100644 index 98653e65751..00000000000 --- a/.github/workflows/lint-eslint.yml +++ /dev/null @@ -1,100 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Lint eslint - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-eslint-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'src/**' - - 'appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '.eslintrc.*' - - '.eslintignore' - - '**.js' - - '**.ts' - - '**.vue' - - lint: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - name: NPM lint - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - - name: Install dependencies - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: npm ci - - - name: Lint - run: npm run lint - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, lint] - - if: always() - - # This is the summary, we just avoid to rename it so that branch protection rules still match - name: eslint - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/lint-info-xml.yml b/.github/workflows/lint-info-xml.yml deleted file mode 100644 index 78610590f76..00000000000 --- a/.github/workflows/lint-info-xml.yml +++ /dev/null @@ -1,38 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Lint info.xml - -on: pull_request - -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-low - - name: info.xml lint - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Download schema - run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd - - - name: Lint info.xml - uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2 - with: - xml-file: ./appinfo/info.xml - xml-schema-file: ./info.xsd diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml deleted file mode 100644 index 18086c8b762..00000000000 --- a/.github/workflows/lint-php-cs.yml +++ /dev/null @@ -1,52 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Lint php-cs - -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 - - name: php-cs - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - - name: Set up php${{ steps.versions.outputs.php-min }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ steps.versions.outputs.php-min }} - 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 }} - - - name: Install dependencies - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Lint - run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 ) diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml deleted file mode 100644 index ae487584c76..00000000000 --- a/.github/workflows/lint-php.yml +++ /dev/null @@ -1,75 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Lint php - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-php-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-versions: ${{ steps.versions.outputs.php-versions }} - steps: - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.0.0 - - php-lint: - runs-on: ubuntu-latest - needs: matrix - strategy: - matrix: - php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}} - - name: php-lint - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - 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 }} - - - name: Lint - run: composer run lint - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: php-lint - - if: always() - - name: php-lint-summary - - steps: - - name: Summary status - run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi diff --git a/.github/workflows/lint-stylelint.yml b/.github/workflows/lint-stylelint.yml deleted file mode 100644 index 7a9eb794b87..00000000000 --- a/.github/workflows/lint-stylelint.yml +++ /dev/null @@ -1,53 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Lint stylelint - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-stylelint-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - lint: - runs-on: ubuntu-latest - - name: stylelint - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - - name: Install dependencies - env: - CYPRESS_INSTALL_BINARY: 0 - run: npm ci - - - name: Lint - run: npm run stylelint diff --git a/.github/workflows/lint-typescript.yml b/.github/workflows/lint-typescript.yml deleted file mode 100644 index 66e7d2eecea..00000000000 --- a/.github/workflows/lint-typescript.yml +++ /dev/null @@ -1,78 +0,0 @@ -# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: AGPL-3.0-or-later -# Based on lint eslint workflow on https://github.com/nextcloud/.github - -name: Lint TypeScript - -on: pull_request - -permissions: - contents: read - -concurrency: - group: lint-typescript-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'src/**' - - 'appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '**.js' - - '**.ts' - - '**.vue' - - typecheck: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - name: NPM typecheck - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Set up node and npm ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version-file: 'package.json' - - - name: Install dependencies - run: npm ci - - - name: Typecheck - run: npm run typescript:check - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, typecheck] - - name: typecheck - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.typecheck.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml deleted file mode 100644 index bc859df2249..00000000000 --- a/.github/workflows/node-test.yml +++ /dev/null @@ -1,110 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Node tests - -on: - pull_request: - push: - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: node-tests-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - '__tests__/**' - - '__mocks__/**' - - 'src/**' - - 'appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '**.js' - - '**.ts' - - '**.vue' - - test: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - # In contrast to the workflow template, there is no build step here - - name: Install dependencies - env: - CYPRESS_INSTALL_BINARY: 0 - run: | - npm ci - - # In contrast to the workflow template, there is no coverage step here - - name: Test - run: npm run test --if-present - - - name: Collect coverage - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 - with: - files: ./coverage/lcov.info - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, test] - - if: always() - - name: test-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml deleted file mode 100644 index 44e351ea85d..00000000000 --- a/.github/workflows/node.yml +++ /dev/null @@ -1,107 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Node - -on: pull_request - -permissions: - contents: read - -concurrency: - group: node-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'src/**' - - 'appinfo/info.xml' - - 'package.json' - - 'package-lock.json' - - 'tsconfig.json' - - '**.js' - - '**.ts' - - '**.vue' - - build: - runs-on: ubuntu-latest - - needs: changes - if: needs.changes.outputs.src != 'false' - - name: NPM build - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - - name: Install dependencies & build - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: | - npm ci - npm run build --if-present - - - name: Check build changes - run: | - 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 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, build] - - if: always() - - # This is the summary, we just avoid to rename it so that branch protection rules still match - name: node - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/occ-command-documentation.yml b/.github/workflows/occ-command-documentation.yml deleted file mode 100644 index c81b56c3d7f..00000000000 --- a/.github/workflows/occ-command-documentation.yml +++ /dev/null @@ -1,93 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Documentation - -on: - pull_request: - paths: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - -permissions: - contents: read - -concurrency: - group: occ-commands-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - occ-commands: - runs-on: ubuntu-latest - - strategy: - matrix: - php-versions: ['8.2'] - server-versions: ['master'] - - steps: - - name: Set app env - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # 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 }} - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Set up dependencies - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ app:enable ${{ env.APP_NAME }} - ./occ config:system:set debug --value true --type boolean - - - name: Check if documentation is up to date - id: check_documentation - run: | - ./occ talk:developer:update-docs - cd apps/${{ env.APP_NAME }} - bash -c "[[ ! \"`git status --porcelain `\" ]] || (cat docs/occ.md && echo 'Documentation outdated. Run the command talk:developer:update-docs locally, commit the occ.md file and push the changes.' && exit 1)" diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml deleted file mode 100644 index 2b2340a86d2..00000000000 --- a/.github/workflows/openapi.yml +++ /dev/null @@ -1,96 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2024 Arthur Schiwon -# SPDX-License-Identifier: MIT - -name: OpenAPI - -on: pull_request - -permissions: - contents: read - -concurrency: - group: openapi-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - openapi: - runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get php version - id: php_versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - - name: Set up php - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ steps.php_versions.outputs.php-available }} - extensions: xml - coverage: none - ini-file: development - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check Typescript OpenApi types - id: check_typescript_openapi - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: "src/types/openapi/openapi*.ts" - - - name: Read package.json node and npm engines version - if: steps.check_typescript_openapi.outputs.files_exists == 'true' - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: node_versions - # Continue if no package.json - continue-on-error: true - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.node_versions.outputs.nodeVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.node_versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.node_versions.outputs.npmVersion }} - if: ${{ steps.node_versions.outputs.nodeVersion }} - run: npm i -g 'npm@${{ steps.node_versions.outputs.npmVersion }}' - - - name: Install dependencies - if: ${{ steps.node_versions.outputs.nodeVersion }} - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: | - npm ci - - - name: Set up dependencies - run: composer i - - - name: Regenerate OpenAPI - run: composer run openapi - - - name: Check openapi*.json and typescript changes - run: | - bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please run \"composer run openapi\" and commit the openapi*.json files and (if applicable) src/types/openapi/openapi*.ts, 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 diff --git a/.github/workflows/opengrep-scan.yml b/.github/workflows/opengrep-scan.yml deleted file mode 100644 index 5e9184a9a77..00000000000 --- a/.github/workflows/opengrep-scan.yml +++ /dev/null @@ -1,49 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: OpenGrep Full Scan - -on: pull_request - -permissions: - contents: read - -jobs: - scan: - name: Scan with OpenGrep - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Install OpenGrep - run: | - # Download the OpenGrep binary - wget $(curl -s https://api.github.com/repos/opengrep/opengrep/releases/latest | grep "/opengrep_manylinux_x86\"" | awk '{print $2}' | sed 's|[\"\,]*||g') -O opengrep - - # Make the binary executable - chmod +x opengrep - # Move the binary to a directory in PATH - sudo mv opengrep /usr/local/bin/opengrep - - - name: Run OpenGrep with custom rules - run: | - composer run opengrep-full -- --sarif --sarif-output findings.sarif - exit_code=$? - if [ $exit_code -ne 0 ]; then - echo "::error::OpenGrep found issues in the code. Check the report for details." - exit 1 - fi - - - name: Show potential changes in OpenGrep results - if: always() - run: git diff --exit-code -- . ':!lib/composer' - - - name: Upload Analysis results to GitHub - if: always() - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: findings.sarif diff --git a/.github/workflows/phpunit-mariadb.yml b/.github/workflows/phpunit-mariadb.yml deleted file mode 100644 index c9c5a4e3e0d..00000000000 --- a/.github/workflows/phpunit-mariadb.yml +++ /dev/null @@ -1,202 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit MariaDB - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-mariadb-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-mariadb: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - mariadb-versions: ['10.6', '11.8'] - - name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - mariadb: - image: ghcr.io/nextcloud/continuous-integration-mariadb-${{ matrix.mariadb-versions }}:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:3306/tcp - env: - MARIADB_ROOT_PASSWORD: rootpassword - options: --health-cmd="mariadb-admin ping" --health-interval 5s --health-timeout 2s --health-retries 5 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Enable ONLY_FULL_GROUP_BY MariaDB 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: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Set up dependencies - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - 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' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-mariadb] - - if: always() - - name: phpunit-mariadb-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mariadb.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml deleted file mode 100644 index 41b1d50094a..00000000000 --- a/.github/workflows/phpunit-mysql.yml +++ /dev/null @@ -1,200 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit MySQL - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-mysql-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - matrix: ${{ steps.versions.outputs.sparse-matrix }} - steps: - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - with: - matrix: '{"mysql-versions": ["8.4"]}' - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-mysql: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} - - name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - mysql: - image: ghcr.io/nextcloud/continuous-integration-mysql-${{ matrix.mysql-versions }}:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:3306/tcp - env: - MYSQL_ROOT_PASSWORD: rootpassword - options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - 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: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Set up dependencies - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - 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' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-mysql] - - if: always() - - name: phpunit-mysql-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-mysql.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/phpunit-oci.yml b/.github/workflows/phpunit-oci.yml deleted file mode 100644 index 8c8f860c94d..00000000000 --- a/.github/workflows/phpunit-oci.yml +++ /dev/null @@ -1,207 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit OCI - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-oci-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src }} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-oci: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - oci-versions: ['11', '18', '21', '23'] - - name: OCI ${{ matrix.oci-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - oracle: - image: ghcr.io/gvenzl/oracle-${{ matrix.oci-versions < 23 && 'xe' || 'free' }}:${{ matrix.oci-versions }} - - # Provide passwords and other environment variables to container - env: - ORACLE_PASSWORD: oracle - - # Forward Oracle port - ports: - - 1521:1521 - - # Provide healthcheck script options for startup - options: >- - --health-cmd healthcheck.sh - --health-interval 20s - --health-timeout 10s - --health-retries 10 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Set up dependencies - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Set up Nextcloud - env: - DB_PORT: 1521 - run: | - mkdir data - ./occ maintenance:install --verbose --database=oci --database-name=${{ matrix.oci-versions < 23 && 'XE' || 'FREE' }} --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=system --database-pass=oracle --admin-user admin --admin-pass admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - 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' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-oci] - - if: always() - - name: phpunit-oci-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-oci.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/phpunit-pgsql.yml b/.github/workflows/phpunit-pgsql.yml deleted file mode 100644 index 513f6783584..00000000000 --- a/.github/workflows/phpunit-pgsql.yml +++ /dev/null @@ -1,198 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit PostgreSQL - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-pgsql-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src }} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-pgsql: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - - name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - services: - postgres: - image: ghcr.io/nextcloud/continuous-integration-postgres-16:latest # zizmor: ignore[unpinned-images] - ports: - - 4444:5432/tcp - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: rootpassword - POSTGRES_DB: nextcloud - options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5 - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Set up dependencies - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - 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' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-pgsql] - - if: always() - - name: phpunit-pgsql-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-pgsql.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/phpunit-sqlite.yml b/.github/workflows/phpunit-sqlite.yml deleted file mode 100644 index 90ace75cbf0..00000000000 --- a/.github/workflows/phpunit-sqlite.yml +++ /dev/null @@ -1,187 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: PHPUnit SQLite - -on: pull_request - -permissions: - contents: read - -concurrency: - group: phpunit-sqlite-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - matrix: - runs-on: ubuntu-latest-low - outputs: - php-version: ${{ steps.versions.outputs.php-available-list }} - server-max: ${{ steps.versions.outputs.branches-max-list }} - steps: - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get version matrix - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - changes: - runs-on: ubuntu-latest-low - permissions: - contents: read - pull-requests: read - - outputs: - src: ${{ steps.changes.outputs.src}} - - steps: - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changes - continue-on-error: true - with: - filters: | - src: - - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - phpunit-sqlite: - runs-on: ubuntu-latest - - needs: [changes, matrix] - if: needs.changes.outputs.src != 'false' - - strategy: - matrix: - php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }} - server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }} - - name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} - - steps: - - name: Set app env - if: ${{ env.APP_NAME == '' }} - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.server-versions }} - - - name: Checkout app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - - - name: Set up php ${{ matrix.php-versions }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ matrix.php-versions }} - # 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check composer file existence - id: check_composer - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 - with: - files: apps/${{ env.APP_NAME }}/composer.json - - - name: Set up dependencies - # Only run if phpunit config file exists - if: steps.check_composer.outputs.files_exists == 'true' - working-directory: apps/${{ env.APP_NAME }} - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Set up Nextcloud - env: - 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 admin - ./occ app:enable --force ${{ env.APP_NAME }} - - - name: Check PHPUnit script is defined - id: check_phpunit - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:unit ' | wc -l | grep 1 - - - name: PHPUnit - # Only run if phpunit config file exists - if: steps.check_phpunit.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - run: composer run test:unit - - - name: Check PHPUnit integration script is defined - id: check_integration - continue-on-error: true - working-directory: apps/${{ env.APP_NAME }} - run: | - composer run --list | grep '^ test:integration ' | wc -l | grep 1 - - - name: Run Nextcloud - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - run: php -S localhost:8080 & - - - name: PHPUnit integration - # Only run if phpunit integration config file exists - if: steps.check_integration.outcome == 'success' - 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' - run: | - echo 'Neither PHPUnit nor PHPUnit integration tests are specified in composer.json scripts' - exit 1 - - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, phpunit-sqlite] - - if: always() - - name: phpunit-sqlite-summary - - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.phpunit-sqlite.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/integration-mysql.yml b/.github/workflows/playwright-test.yml similarity index 58% rename from .github/workflows/integration-mysql.yml rename to .github/workflows/playwright-test.yml index 806bc1980d1..85004e0ae65 100644 --- a/.github/workflows/integration-mysql.yml +++ b/.github/workflows/playwright-test.yml @@ -1,23 +1,19 @@ -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT -name: Integration mysql +name: Playwright tests on: pull_request: - paths: - # Only running on PR for this file to save CI time (otherwise pgsql only) - - '.github/workflows/integration-mysql.yml' - schedule: - - cron: "5 2 * * *" + push: + branches: + - main + - master + - stable* permissions: contents: read -concurrency: - group: integration-mysql-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - jobs: changes: runs-on: ubuntu-latest-low @@ -33,30 +29,28 @@ jobs: filters: | src: - '.github/workflows/**' - - 'appinfo/**' - - 'lib/**' - - 'templates/**' - - 'tests/integration/**' - - 'vendor/**' - - 'vendor-bin/**' - - '.php-cs-fixer.dist.php' - - 'composer.json' - - 'composer.lock' - - integration-mysql: + - 'src/**' + - 'appinfo/info.xml' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - '**.js' + - '**.ts' + - '**.vue' + + playwright-test: runs-on: ubuntu-latest + name: Run Playwright tests + needs: changes if: needs.changes.outputs.src != 'false' strategy: fail-fast: false matrix: - test-suite: ['callapi', 'chat-1', 'chat-2', 'chat-3', 'chat-4', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['master'] - guests-versions: ['main'] - circles-versions: ['master'] notifications-versions: ['master'] services: @@ -75,6 +69,7 @@ jobs: echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - name: Checkout server + if: ${{ matrix.branches != 'main' }} uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false @@ -83,27 +78,12 @@ jobs: ref: ${{ matrix.server-versions }} - name: Checkout app + id: checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: persist-credentials: false path: apps/${{ env.APP_NAME }} - - name: Checkout circles app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/circles - path: apps/circles - ref: ${{ matrix.circles-versions }} - - - name: Checkout guests app - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - repository: nextcloud/guests - path: apps/guests - ref: ${{ matrix.guests-versions }} - - name: Checkout notifications app uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: @@ -134,10 +114,6 @@ jobs: working-directory: apps/${{ env.APP_NAME }} run: composer i --no-dev - - name: Set up behat dependencies - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: composer i - - name: Set up Nextcloud env: DB_PORT: 4444 @@ -149,41 +125,46 @@ jobs: ./occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu" ./occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu" ./occ app:enable --force ${{ env.APP_NAME }} - ./occ app:enable --force circles - ./occ app:enable --force guests ./occ app:enable --force notifications - - name: Run integration - working-directory: apps/${{ env.APP_NAME }}/tests/integration - run: bash run.sh features/${{ matrix.test-suite }} - - - name: Print logs - if: always() - run: | - cat data/nextcloud.log + - name: Run Nextcloud + # Only run if phpunit integration config file exists + if: steps.checkout.outcome == 'success' + run: php -S localhost:8080 & - - name: Check Federation log - if: always() - id: check_federation_log - uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0 + - name: Read package.json node and npm engines version + if: steps.checkout.outcome == 'success' + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions with: - files: "data/tests-talk-real-federated-server/data/nextcloud.log" - - - name: Print federation logs - if: always() && steps.check_federation_log.outputs.files_exists == 'true' - run: | - cat data/tests-talk-real-federated-server/data/nextcloud.log + fallbackNode: '^20' + fallbackNpm: '^10' - summary: - permissions: - contents: none - runs-on: ubuntu-latest-low - needs: [changes, integration-mysql] + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + if: steps.checkout.outcome == 'success' + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} - if: always() + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + if: steps.checkout.outcome == 'success' + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - name: integration-mysql-summary + - name: Install dependencies + if: steps.checkout.outcome == 'success' + working-directory: apps/${{ env.APP_NAME }} + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + npx playwright install --with-deps - steps: - - name: Summary status - run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-mysql.result != 'success' }}; then exit 1; fi + - name: Run tests + if: steps.checkout.outcome == 'success' + working-directory: apps/${{ env.APP_NAME }} + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm run test:e2e diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml deleted file mode 100644 index f4c0477ce71..00000000000 --- a/.github/workflows/pr-feedback.yml +++ /dev/null @@ -1,55 +0,0 @@ -# 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 - -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2023 Marcel Klehr -# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com> -# SPDX-FileCopyrightText: 2023 Daniel Kesselberg -# SPDX-FileCopyrightText: 2023 Florian Steffens -# SPDX-License-Identifier: MIT - -name: 'Ask for feedback on PRs' -on: - schedule: - - cron: '30 1 * * *' - -permissions: - contents: read - pull-requests: write - -jobs: - pr-feedback: - if: ${{ github.repository_owner == 'nextcloud' }} - runs-on: ubuntu-latest - steps: - - name: The get-github-handles-from-website action - uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1 - id: scrape - with: - website: 'https://nextcloud.com/team/' - - - name: Get blocklist - id: blocklist - run: | - blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) - echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" - - - uses: nextcloud/pr-feedback-action@f0cab224dea8e1f282f9451de322f323c78fc7a5 # main - with: - feedback-message: | - Hello there, - Thank you so much for taking the time and effort to create a pull request to our Nextcloud project. - - We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. - - Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 - - Thank you for contributing to Nextcloud and we hope to hear from you soon! - - (If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).) - days-before-feedback: 14 - start-date: '2025-06-12' - exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}' - exempt-bots: true diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml deleted file mode 100644 index 3059026e02f..00000000000 --- a/.github/workflows/psalm.yml +++ /dev/null @@ -1,62 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Static analysis - -on: pull_request - -concurrency: - group: psalm-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - static-analysis: - runs-on: ubuntu-latest - - name: static-psalm-analysis - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Get php version - id: versions - uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1 - - - name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml - run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml - - - name: Set up php${{ steps.versions.outputs.php-available }} - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: ${{ steps.versions.outputs.php-available }} - 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 - # Temporary workaround for missing pcntl_* in PHP 8.3 - ini-values: disable_functions= - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install dependencies - run: | - composer remove nextcloud/ocp --dev --no-scripts - composer i - - - name: Check for vulnerable PHP dependencies - run: composer require --dev roave/security-advisories:dev-latest - - - name: Install nextcloud/ocp - run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies - - - name: Run coding standards check - run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml deleted file mode 100644 index 0508946e9e9..00000000000 --- a/.github/workflows/reuse.yml +++ /dev/null @@ -1,27 +0,0 @@ -# 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 - -# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. -# -# SPDX-License-Identifier: CC0-1.0 - -name: REUSE Compliance Check - -on: [pull_request] - -permissions: - contents: read - -jobs: - reuse-compliance-check: - runs-on: ubuntu-latest-low - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: REUSE Compliance Check - uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0 diff --git a/.github/workflows/update-nextcloud-ocp-approve-merge.yml b/.github/workflows/update-nextcloud-ocp-approve-merge.yml deleted file mode 100644 index dfe0ef4e972..00000000000 --- a/.github/workflows/update-nextcloud-ocp-approve-merge.yml +++ /dev/null @@ -1,58 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Auto approve nextcloud/ocp - -on: - pull_request_target: # zizmor: ignore[dangerous-triggers] - branches: - - main - - master - - stable* - -permissions: - contents: read - -concurrency: - group: update-nextcloud-ocp-approve-merge-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - auto-approve-merge: - if: github.actor == 'nextcloud-command' - runs-on: ubuntu-latest-low - permissions: - # for hmarr/auto-approve-action to approve PRs - pull-requests: write - # for alexwilson/enable-github-automerge-action to approve PRs - contents: write - - steps: - - name: Disabled on forks - if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - run: | - echo 'Can not approve PRs from forks' - exit 1 - - - uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0 - id: branchname - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - # GitHub actions bot approve - - uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2 - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - # Enable GitHub auto merge - - name: Auto merge - uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0 - if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp') - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-nextcloud-ocp.yml b/.github/workflows/update-nextcloud-ocp.yml deleted file mode 100644 index 1cb5219952c..00000000000 --- a/.github/workflows/update-nextcloud-ocp.yml +++ /dev/null @@ -1,124 +0,0 @@ -# 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 -# -# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Update nextcloud/ocp - -on: - workflow_dispatch: - schedule: - - cron: "5 2 * * 0" - -permissions: - contents: read - issues: write - -jobs: - update-nextcloud-ocp: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - branches: ['main', 'master', 'stable32', 'stable31', 'stable30'] - - name: update-nextcloud-ocp-${{ matrix.branches }} - - steps: - - id: checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - ref: ${{ matrix.branches }} - submodules: true - continue-on-error: true - - - name: Set up php8.2 - if: steps.checkout.outcome == 'success' - uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # v2.35.5 - with: - php-version: 8.2 - # 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 }} - - - name: Read codeowners - if: steps.checkout.outcome == 'success' - id: codeowners - run: | - grep '/appinfo/info.xml' .github/CODEOWNERS | cut -f 2- -d ' ' | xargs | awk '{ print "codeowners="$0 }' >> $GITHUB_OUTPUT - continue-on-error: true - - - name: Composer install - if: steps.checkout.outcome == 'success' - run: composer install - - - name: Composer update nextcloud/ocp - id: update_branch - if: ${{ steps.checkout.outcome == 'success' && matrix.branches != 'main' }} - run: composer require --dev 'nextcloud/ocp:dev-${{ matrix.branches }}' - - - name: Raise on issue on failure - uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 - if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_branch.conclusion == 'failure' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}' - body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' - - - name: Composer update nextcloud/ocp - id: update_main - if: ${{ steps.checkout.outcome == 'success' && matrix.branches == 'main' }} - run: composer require --dev nextcloud/ocp:dev-master - - - name: Raise on issue on failure - uses: dacbd/create-issue-action@cdb57ab6ff8862aa09fee2be6ba77a59581921c2 # v2.0.0 - if: ${{ steps.checkout.outcome == 'success' && failure() && steps.update_main.conclusion == 'failure' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - title: 'Failed to update nextcloud/ocp package on branch ${{ matrix.branches }}' - body: 'Please check the output of the GitHub action and manually resolve the issues
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ steps.codeowners.outputs.codeowners }}' - - - name: Reset checkout 3rdparty - if: steps.checkout.outcome == 'success' - run: | - git clean -f 3rdparty - git checkout 3rdparty - continue-on-error: true - - - name: Reset checkout vendor - if: steps.checkout.outcome == 'success' - run: | - git clean -f vendor - git checkout vendor - continue-on-error: true - - - name: Reset checkout vendor-bin - if: steps.checkout.outcome == 'success' - run: | - git clean -f vendor-bin - git checkout vendor-bin - continue-on-error: true - - - name: Create Pull Request - if: steps.checkout.outcome == 'success' - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 - with: - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: 'chore(dev-deps): Bump nextcloud/ocp package' - committer: GitHub - author: nextcloud-command - signoff: true - branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-ocp' - title: '[${{ matrix.branches }}] Update nextcloud/ocp dependency' - body: | - Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency - labels: | - dependencies - 3. to review diff --git a/.github/workflows/update-nextcloud-openapi.yml b/.github/workflows/update-nextcloud-openapi.yml deleted file mode 100644 index fec9eb01422..00000000000 --- a/.github/workflows/update-nextcloud-openapi.yml +++ /dev/null @@ -1,102 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT - -name: Update nextcloud/openapi - -on: - workflow_dispatch: - schedule: - - cron: "5 4 * * 0" - -permissions: - contents: read - -jobs: - update-nextcloud-openapi: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - branches: ['main', 'master', 'stable31', 'stable30'] - - name: Update Nextcloud OpenAPI types from core - - steps: - - name: Set app env - run: | - # Split and keep last - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Checkout server - if: ${{ matrix.branches != 'main' }} - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: ${{ matrix.branches }} - - - name: Checkout server (Main) - if: ${{ matrix.branches == 'main' }} - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - submodules: true - repository: nextcloud/server - ref: master - - - name: Checkout app - id: checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - path: apps/${{ env.APP_NAME }} - ref: ${{ matrix.branches }} - continue-on-error: true - - - name: Read package.json node and npm engines version - if: steps.checkout.outcome == 'success' - uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 - id: versions - with: - fallbackNode: '^20' - fallbackNpm: '^10' - - - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - if: steps.checkout.outcome == 'success' - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version: ${{ steps.versions.outputs.nodeVersion }} - - - name: Set up npm ${{ steps.versions.outputs.npmVersion }} - if: steps.checkout.outcome == 'success' - run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - - name: Install dependencies & generate types - if: steps.checkout.outcome == 'success' - working-directory: apps/${{ env.APP_NAME }} - env: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_DOWNLOAD: true - run: | - npm ci - npm run typescript:generate-core-types --if-present - - - name: Create Pull Request - if: steps.checkout.outcome == 'success' - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 - with: - path: apps/${{ env.APP_NAME }} - token: ${{ secrets.COMMAND_BOT_PAT }} - commit-message: 'chore(ts): update OpenAPI types from core' - committer: GitHub - author: nextcloud-command - signoff: true - branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-openapi' - title: '[${{ matrix.branches }}] Update Nextcloud OpenAPI types' - body: | - Auto-generated update of Nextcloud OpenAPI types - labels: | - dependencies - 3. to review diff --git a/.github/workflows/update-stable-titles.yml b/.github/workflows/update-stable-titles.yml deleted file mode 100644 index 1c0c54e0247..00000000000 --- a/.github/workflows/update-stable-titles.yml +++ /dev/null @@ -1,69 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors -# SPDX-License-Identifier: MIT -name: Update PRs titles on stable branches - -on: - pull_request: - types: [opened, edited] - branches: - - "stable*" - -concurrency: - group: stable-pr-title-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - update-pr-title: - runs-on: ubuntu-latest-low - permissions: - pull-requests: write - contents: read - - steps: - - name: Wait for potential title edits - run: sleep 15 - - - name: Get PR details and update title - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - }); - - const baseBranch = pr.base.ref; - const currentTitle = pr.title; - - // Check if this is a stable branch - // Should not happen as we only trigger on stable* branches 🤷‍♀️ - if (!baseBranch.startsWith('stable')) { - console.log(`Not a stable branch: ${baseBranch}`); - return; - } - - const prefix = `[${baseBranch}]`; - - // Check if title already has the correct prefix and no other stable tags - const correctTagRegex = new RegExp(`^\\[${baseBranch}\\]\\s*`); - const hasOtherStableTags = /\[stable[\d.]*\]/.test(currentTitle.replace(correctTagRegex, '')); - - if (correctTagRegex.test(currentTitle) && !hasOtherStableTags) { - console.log(`Title already has correct prefix only: ${currentTitle}`); - return; - } - - // Remove all stable tags and add the correct one - const cleanTitle = currentTitle.replace(/\[stable[\d.]*\]\s*/g, '').trim(); - const newTitle = `${prefix} ${cleanTitle}`; - - console.log(`Updating title from: "${currentTitle}" to: "${newTitle}"`); - - await github.rest.pulls.update({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number, - title: newTitle, - }); diff --git a/.gitignore b/.gitignore index 60011888296..12a63ed94dd 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,12 @@ /drone /findings.sarif +# Playwright +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ + # PHP Dev server output (integration tests) /tests/integration/phpserver*.log diff --git a/package-lock.json b/package-lock.json index 960051477e7..1a35acbf287 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "@nextcloud/sharing": "^0.3.0", "@nextcloud/upload": "^2.0.0-rc.0", "@nextcloud/vue": "^9.0.0", + "@playwright/test": "^1.56.0", "@vue-leaflet/vue-leaflet": "^0.10.1", "@vueuse/components": "^13.7.0", "@vueuse/core": "^13.7.0", @@ -2110,6 +2111,21 @@ "node": ">=14" } }, + "node_modules/@playwright/test": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.0.tgz", + "integrity": "sha512-Tzh95Twig7hUwwNe381/K3PggZBZblKUe2wv25oIpzWLr6Z0m4KgV1ZVIjnR6GM9ANEqjZD7XsZEa6JL/7YEgg==", + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.56.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@polka/url": { "version": "1.0.0-next.23", "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.23.tgz", @@ -11662,6 +11678,50 @@ "node": ">= 6" } }, + "node_modules/playwright": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0.tgz", + "integrity": "sha512-X5Q1b8lOdWIE4KAoHpW3SE8HvUB+ZZsUoN64ZhjnN8dOb1UpujxBtENGiZFE+9F/yhzJwYa+ca3u43FeLbboHA==", + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.56.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0.tgz", + "integrity": "sha512-1SXl7pMfemAMSDn5rkPeZljxOCYAmQnYLBTExuh6E8USHXGSX3dx6lYZN/xPpTz1vimXmPA9CDnILvmJaB8aSQ==", + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -17098,6 +17158,14 @@ "dev": true, "optional": true }, + "@playwright/test": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.0.tgz", + "integrity": "sha512-Tzh95Twig7hUwwNe381/K3PggZBZblKUe2wv25oIpzWLr6Z0m4KgV1ZVIjnR6GM9ANEqjZD7XsZEa6JL/7YEgg==", + "requires": { + "playwright": "1.56.0" + } + }, "@polka/url": { "version": "1.0.0-next.23", "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.23.tgz", @@ -23854,6 +23922,28 @@ "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", "dev": true }, + "playwright": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0.tgz", + "integrity": "sha512-X5Q1b8lOdWIE4KAoHpW3SE8HvUB+ZZsUoN64ZhjnN8dOb1UpujxBtENGiZFE+9F/yhzJwYa+ca3u43FeLbboHA==", + "requires": { + "fsevents": "2.3.2", + "playwright-core": "1.56.0" + }, + "dependencies": { + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "optional": true + } + } + }, + "playwright-core": { + "version": "1.56.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0.tgz", + "integrity": "sha512-1SXl7pMfemAMSDn5rkPeZljxOCYAmQnYLBTExuh6E8USHXGSX3dx6lYZN/xPpTz1vimXmPA9CDnILvmJaB8aSQ==" + }, "pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", diff --git a/package.json b/package.json index 594c6ee7f01..ffbec0fbacb 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "stylelint:fix": "stylelint \"src/**/*.scss\" \"src/**/*.vue\" --fix", "test": "vitest", "test:coverage": "vitest run --coverage", + "test:e2e": "npx playwright test", + "test:e2e:ui": "npx playwright test --ui", "typescript:check": "vue-tsc --noEmit", "typescript:generate": "npx openapi-typescript -t", "typescript:generate-core-types": "./src/types/generate-core-types.sh", @@ -46,6 +48,7 @@ "@nextcloud/sharing": "^0.3.0", "@nextcloud/upload": "^2.0.0-rc.0", "@nextcloud/vue": "^9.0.0", + "@playwright/test": "^1.56.0", "@vue-leaflet/vue-leaflet": "^0.10.1", "@vueuse/components": "^13.7.0", "@vueuse/core": "^13.7.0", diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 00000000000..d330b06f754 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,82 @@ +import { defineConfig, devices } from '@playwright/test' + +/** + * Read environment variables from file. + * https://github.com/motdotla/dotenv + */ +// import dotenv from 'dotenv'; +// import path from 'path'; +// dotenv.config({ path: path.resolve(__dirname, '.env') }); + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './tests/e2e', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: 'http://localhost:8080/index.php/', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + + /* Ignore HTTPS errors | SSL certificate */ + ignoreHTTPSErrors: true, + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + // + // { + // name: 'firefox', + // use: { ...devices['Desktop Firefox'] }, + // }, + // + // { + // name: 'webkit', + // use: { ...devices['Desktop Safari'] }, + // }, + + /* Test against mobile viewports. */ + // { + // name: 'Mobile Chrome', + // use: { ...devices['Pixel 5'] }, + // }, + // { + // name: 'Mobile Safari', + // use: { ...devices['iPhone 12'] }, + // }, + + /* Test against branded browsers. */ + // { + // name: 'Microsoft Edge', + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, + // }, + // { + // name: 'Google Chrome', + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, + // }, + ], + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // url: 'http://localhost:3000', + // reuseExistingServer: !process.env.CI, + // }, +}) diff --git a/tests/e2e/example.spec.ts b/tests/e2e/example.spec.ts new file mode 100644 index 00000000000..535e14b6225 --- /dev/null +++ b/tests/e2e/example.spec.ts @@ -0,0 +1,37 @@ +import type { Page } from '@playwright/test' + +import { expect, test } from '@playwright/test' + +async function login(page: Page, { login, password, location }: { + login: string + password: string + location: string +}) { + await page.goto('apps/spreed/') + await page.getByRole('textbox', { name: 'Account name or email' }).fill('admin') + await page.getByRole('textbox', { name: 'Password' }).fill('admin') + await page.getByRole('button', { name: 'Log in', exact: true }).click() + await page.waitForURL('apps/spreed/') +} + +test('can open app', async ({ page }) => { + await login(page, { login: 'admin', password: 'admin', location: 'apps/spreed/' }) + // Expect a title "to contain" a substring. + await expect(page).toHaveTitle(/Talk - Nextcloud/) +}) + +test('can open a conversation', async ({ page }) => { + await login(page, { login: 'admin', password: 'admin', location: 'apps/spreed/' }) + await page.getByRole('textbox', { name: 'Search …' }).fill('test') + await page.locator('a[href="/index.php/call/biiwputz"]').click() + await page.waitForURL('call/biiwputz') + + const selector = '.rich-contenteditable__input' + await expect(page.locator(selector)).toBeVisible() + await page.waitForFunction((selector) => document.querySelector(selector)!.getAttribute('contenteditable') === 'true', selector) + // Expects page to have a heading with the name of Installation. + // await expect(page.getByRole('textbox', { name: 'Write a message' })).toBeVisible() + await page.locator(selector).fill('wololo') + + await page.locator('button[aria-label="Send message"]').click() +})