Skip to content

Commit a846635

Browse files
committed
Merge branch 'feature/qa' into prep-release-0.10
2 parents f5c1018 + 1a5177e commit a846635

File tree

9 files changed

+203
-143
lines changed

9 files changed

+203
-143
lines changed

.github/workflows/php.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,31 @@ jobs:
7373
strategy:
7474
fail-fast: false
7575
matrix:
76-
php:
77-
- '8.0' # from 2020-11 to 2022-11 (2023-11)
78-
- '8.1' # from 2021-11 to 2023-11 (2025-12)
79-
- '8.2' # from 2022-12 to 2024-12 (2026-12)
80-
- '8.3' # from 2023-11 to 2025-12 (2027-12)
76+
nextcloud_version:
77+
- 28
78+
- 29
79+
- 30
8180
steps:
8281
- uses: actions/checkout@v4
8382
- uses: shivammathur/setup-php@v2
8483
with:
85-
coverage: xdebug
8684
ini-values: error_reporting=E_ALL, display_errors=On
87-
php-version: ${{ matrix.php }}
85+
php-version: 8.3
8886
- name: Install and Cache Composer dependencies
8987
uses: "ramsey/composer-install@v2"
9088
with:
9189
working-directory: "solid"
9290
env:
9391
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
94-
- run: bin/phpunit --configuration .config/phpunit.xml.dist
92+
- run: |
93+
docker run \
94+
--env 'XDEBUG_MODE=coverage' \
95+
--rm \
96+
--volume="./solid:/var/www/html/apps/solid" \
97+
--workdir=/var/www/html/apps/solid \
98+
ghcr.io/pdsinterop/solid-nextcloud:179_merge-${{ matrix.nextcloud_version }} \
99+
bin/phpunit --configuration phpunit.xml
100+
95101
# 03.quality.php.scan.dependencies-vulnerabilities.yml
96102
scan-dependencies-vulnerabilities:
97103
name: Scan Dependencies Vulnerabilities

Dockerfile

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
ARG NEXTCLOUD_VERSION
2+
ARG XDEBUG_VERSION
3+
24
FROM nextcloud:${NEXTCLOUD_VERSION}
35

4-
RUN apt-get update && apt-get install --no-install-recommends -yq \
6+
SHELL ["/bin/bash", "-c"]
7+
8+
RUN apt-get update \
9+
&& read -ra PHPIZE_DEPS <<< "${PHPIZE_DEPS}" \
10+
&& apt-get install --no-install-recommends -yq \
511
git \
612
sudo \
713
vim \
814
zip \
15+
"${PHPIZE_DEPS[@]}" \
916
&& rm -rf /var/lib/apt/lists/* \
1017
&& a2enmod ssl \
1118
&& mkdir /tls \
@@ -15,13 +22,24 @@ RUN apt-get update && apt-get install --no-install-recommends -yq \
1522
-subj "/C=RO/ST=Bucharest/L=Bucharest/O=IT/CN=www.example.ro"
1623

1724
COPY solid/ /usr/src/nextcloud/apps/solid
25+
COPY docker/xdebug.sh /xdebug.sh
1826
COPY init.sh /
1927
COPY init-live.sh /
2028
COPY site.conf /etc/apache2/sites-enabled/000-default.conf
2129

2230
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
23-
RUN composer install --working-dir=/usr/src/nextcloud/apps/solid --no-dev --prefer-dist \
24-
&& rm /usr/local/bin/composer
31+
32+
RUN composer install --working-dir=/usr/src/nextcloud/apps/solid --prefer-dist \
33+
&& sh /xdebug.sh \
34+
&& pecl install "xdebug-$(cat /xdebug.version)" \
35+
&& docker-php-ext-enable xdebug \
36+
&& NEXTCLOUD_ADMIN_PASSWORD='alice123' \
37+
NEXTCLOUD_ADMIN_USER='alice' \
38+
NEXTCLOUD_TRUSTED_DOMAINS='localhost server thirdparty nextcloud.local *.nextcloud.local' \
39+
NEXTCLOUD_UPDATE=1 \
40+
/entrypoint.sh 'echo' \
41+
&& php /var/www/html/console.php maintenance:install --admin-user='alice' --admin-pass='alice123' \
42+
&& php /var/www/html/console.php app:enable solid
2543

2644
WORKDIR /var/www/html
2745
EXPOSE 443

docker/xdebug.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit # Exit script when a command exits with non-zero status.
4+
#set -o errtrace # Exit on error inside any functions or sub-shells.
5+
set -o nounset # Exit script on use of an undefined variable.
6+
#set -o pipefail # Return exit status of the last command in the pipe that exited with a non-zero exit code
7+
8+
if [ -z "${NEXTCLOUD_VERSION}" ]; then
9+
echo >&2 'The "NEXTCLOUD_VERSION" variable MUST be set during build: docker build --build-arg "NEXTCLOUD_VERSION=..."'
10+
exit 65
11+
else
12+
echo "NEXTCLOUD_VERSION is set to '${NEXTCLOUD_VERSION}'"
13+
fi
14+
15+
PHP_VERSION="${PHP_VERSION:-$(php -r 'echo PHP_VERSION;')}"
16+
PHP_MAJOR="${PHP_VERSION%%.*}"
17+
PHP_MINOR="$(echo "${PHP_VERSION}" | awk -F. '{print $2}')"
18+
19+
if [ -z "${XDEBUG_VERSION:-}" ]; then
20+
if [ "$PHP_MAJOR" -eq 8 ]; then
21+
XDEBUG_VERSION=3.4.3
22+
elif [ "$PHP_MAJOR" -eq 7 ]; then
23+
if [ "$PHP_MINOR" -ge 2 ] && [ "$PHP_MINOR" -le 4 ]; then
24+
XDEBUG_VERSION=3.1.6
25+
elif [ "$PHP_MINOR" -eq 1 ]; then
26+
XDEBUG_VERSION=2.9.8
27+
elif [ "$PHP_MINOR" -eq 0 ]; then
28+
XDEBUG_VERSION=2.7.2
29+
else
30+
echo >&2 "Unsupported PHP 7 minor version: $PHP_MINOR"
31+
exit 66
32+
fi
33+
elif [ "$PHP_MAJOR" -eq 5 ]; then
34+
if [ "$PHP_MINOR" -ge 5 ] && [ "$PHP_MINOR" -le 6 ]; then
35+
XDEBUG_VERSION=2.5.5
36+
elif [ "$PHP_MINOR" -eq 4 ]; then
37+
XDEBUG_VERSION=2.4.1
38+
else
39+
echo >&2 "Unsupported PHP 5 minor version: $PHP_MINOR"
40+
exit 67
41+
fi
42+
else
43+
echo >&2 "Unsupported PHP version: ${PHP_VERSION}"
44+
exit 68
45+
fi
46+
fi
47+
48+
echo "${XDEBUG_VERSION}" > /xdebug.version

solid/composer.json

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,6 @@
3737
},
3838
"require-dev": {
3939
"doctrine/dbal": "*",
40-
"nextcloud/server": "*",
4140
"phpunit/phpunit": "^8 || ^9"
42-
},
43-
"repositories": [
44-
{
45-
"type": "package",
46-
"package": {
47-
"name": "nextcloud/server",
48-
"version": "27.0.0",
49-
"dist": {
50-
"url": "https://github.com/nextcloud/server/archive/refs/tags/v27.0.0.zip",
51-
"type": "zip"
52-
},
53-
"source": {
54-
"url": "https://github.com/nextcloud/server.git",
55-
"type": "git",
56-
"reference": "master"
57-
},
58-
"autoload": {
59-
"psr-4": {
60-
"": "lib/private/legacy",
61-
"OC\\": "lib/private",
62-
"OC\\Core\\": "core/",
63-
"OCP\\": "lib/public"
64-
}
65-
}
66-
}
67-
}
68-
]
41+
}
6942
}

0 commit comments

Comments
 (0)