Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 30 additions & 39 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "PHP",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/php:1-8.3-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Configure tool-specific properties.
// "customizations": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
80
],
"containerEnv": {
"XDEBUG_MODE": "debug,develop"
},
"customizations": {
"vscode": {
"extensions": [
"CharlieGerard.pride-vscode-themes",
"junstyle.php-cs-fixer",
"stylelint.vscode-stylelint",
"jetmartin.bats",
"recca0120.vscode-phpunit"
]
}
},
// Use 'postCreateCommand' to run commands after the container is created.
"postStartCommand": ".devcontainer/postCreateCommands.sh",
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/edouard-lopez/devcontainer-features/bats:0": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/wxw-matt/devcontainer-features/apt:latest": {
"packages": "bash-completion vim iputils-ping telnet"
}
}
}
"name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php:1-8.3-bullseye",
"forwardPorts": [
80
],
"containerEnv": {
"XDEBUG_MODE": "debug,develop"
},
"customizations": {
"vscode": {
"extensions": [
"CharlieGerard.pride-vscode-themes",
"junstyle.php-cs-fixer",
"stylelint.vscode-stylelint",
"jetmartin.bats",
"recca0120.vscode-phpunit"
]
}
},
"postStartCommand": ".devcontainer/postCreateCommands.sh",
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/edouard-lopez/devcontainer-features/bats:0": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/wxw-matt/devcontainer-features/apt:latest": {
"packages": "bash-completion vim iputils-ping telnet"
}
}
}
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2025 Lennart Dohmann <[email protected]>

SPDX-License-Identifier: AGPL-3.0-or-later
12 changes: 6 additions & 6 deletions .devcontainer/postCreateCommands.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2025 Lennart Dohmann <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

bash -i -c 'nvm install 20'
bash -i -c 'nvm use 20'

Expand All @@ -26,9 +30,5 @@ NEXTCLOUD_VERSION=$(grep -oP -m 1 "[0-9]+\.[0-9]+\.[0-9]+" install.sh)

mkdir -p ~/.ssh/

rm -rf nextcloud-server/
git clone --depth 1 --recurse-submodules --single-branch --branch v$NEXTCLOUD_VERSION https://github.com/nextcloud/server.git ./nextcloud-server
cd nextcloud-server
git submodule update --init
cd -
./install.sh
./get-nc-server.sh "$NEXTCLOUD_VERSION"
./install.sh
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2025 Lennart Dohmann <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

root = true

[*]
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120

[*.{js,ts,jsx,tsx,html,css,scss,sass,php}]
indent_style = tab

[*.{yml,yaml,json,txt}]
trim_trailing_whitespace = false
indent_size = 2

[Makefile]
indent_style = tab
15 changes: 15 additions & 0 deletions .github/workflows/editorconfig-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2025 Lennart Dohmann <[email protected]>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

name: editorconfig-checker

on: pull_request

jobs:
editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: editorconfig-checker/action-editorconfig-checker@main
- run: editorconfig-checker -exclude "\.sh|\.ya?ml|\.md|\.gitignore|\.json|admin\.php|Dockerfile\.Nextcloud|\.txt|Makefile|\.xml|\.bats|\.env-test|\.ini"
97 changes: 97 additions & 0 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# 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


jobs:
changes:
runs-on: ubuntu-latest
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@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.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
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
35 changes: 35 additions & 0 deletions .github/workflows/lint-info-xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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


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

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
49 changes: 49 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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


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@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
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 )
72 changes: 72 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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


jobs:
matrix:
runs-on: ubuntu-latest
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@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
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
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
Loading
Loading