Skip to content

Commit 39188d8

Browse files
authored
Merge pull request #463 from kbsali/housekeeping
Housekeeping for v2.10.0
2 parents 9458507 + 8017dd7 commit 39188d8

17 files changed

Lines changed: 123 additions & 34 deletions

.docker/Behat-Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM php:7.4-fpm
2+
3+
RUN apt-get update
4+
RUN apt-get --yes --no-install-recommends install \
5+
apt-utils \
6+
git \
7+
vim \
8+
curl \
9+
build-essential \
10+
locales \
11+
zip unzip \
12+
libfreetype6-dev \
13+
libjpeg62-turbo-dev \
14+
libmagickwand-dev \
15+
libpng-dev \
16+
libzip-dev
17+
RUN docker-php-ext-configure gd \
18+
--with-freetype \
19+
--with-jpeg
20+
RUN docker-php-ext-install -j$(nproc) \
21+
pdo \
22+
pdo_mysql \
23+
mysqli \
24+
zip \
25+
exif \
26+
intl \
27+
sockets \
28+
gd \
29+
bcmath \
30+
opcache
31+
32+
COPY build/php/opcache.ini /usr/local/etc/php/conf.d/
33+
COPY build/php/custom.ini /usr/local/etc/php/conf.d/
34+
35+
RUN pecl install xdebug-3.1.6 && docker-php-ext-enable xdebug
36+
37+
RUN php --version
38+
39+
# Install Composer
40+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
41+
# COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
42+
43+
RUN composer --version
44+
45+
RUN usermod -u 33 www-data
46+
RUN usermod -a -G www-data root
47+
RUN mkdir -p /var/www/.composer
48+
RUN chown -R www-data:www-data /var/www
49+
50+
WORKDIR /var/www/project/
51+
52+
USER www-data

.docker/PHP74-Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ RUN mkdir -p /var/www/.composer
4848
RUN chown -R www-data:www-data /var/www
4949

5050
WORKDIR /var/www/project/
51+
52+
USER www-data

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.* export-ignore
2-
docker-compose.yml
3-
phpunit.xml.dist export-ignore
2+
docker-compose.yml export-ignore
3+
phpunit.dist.xml export-ignore
44
tests export-ignore

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: "ramsey/composer-install@v2"
3636

3737
- name: Run tests
38-
run: vendor/bin/phpunit --no-coverage
38+
run: composer run phpunit -- --no-coverage
3939

4040
# This does not work
4141
# behat:
@@ -121,7 +121,7 @@ jobs:
121121

122122
- name: Run tests with coverage-clover
123123
if: ${{ matrix.tool == 'code-coverage' }}
124-
run: composer run phpunit -- -c tests/phpunit-coverage.xml.dist --coverage-clover .phpunit.cache/clover.xml
124+
run: vendor/bin/phpunit -c tests/phpunit-coverage.dist.xml --coverage-clover .phpunit.cache/clover.xml
125125

126126
- name: Upload coverage reports to Codecov
127127
if: ${{ matrix.tool == 'code-coverage' }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.docker/redmine-*_data
22
/.php-cs-fixer.cache
3+
/.php-cs-fixer.php
34
/.phpunit.cache
45
/composer.lock
56
/phpunit.xml

.rector.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
\Rector\Set\ValueObject\SetList::CODE_QUALITY,
1616
\Rector\Set\ValueObject\SetList::DEAD_CODE,
1717
\Art4\RectorBcLibrary\Set::BC_TYPE_DECLARATION,
18-
])
19-
->withSkip([
20-
\Rector\DeadCode\Rector\PropertyProperty\RemoveNullPropertyInitializationRector::class,
18+
\Rector\Set\ValueObject\SetList::PHP_POLYFILLS,
19+
\Rector\Set\ValueObject\SetList::EARLY_RETURN,
20+
\Rector\Set\ValueObject\SetList::INSTANCEOF,
21+
\Rector\Set\ValueObject\SetList::STRICT_BOOLEANS,
22+
\Rector\Set\ValueObject\SetList::PRIVATIZATION,
2123
])
2224
;

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kbsali/redmine-api",
3-
"version": "v2.9.0",
3+
"version": "v2.10.0-dev",
44
"type": "library",
55
"description": "Redmine API client",
66
"homepage": "https://github.com/kbsali/php-redmine-api",
@@ -31,12 +31,12 @@
3131
},
3232
"require-dev": {
3333
"art4/rector-bc-library": "^1.0",
34-
"behat/behat": "^3.14",
35-
"friendsofphp/php-cs-fixer": "^3.68",
36-
"guzzlehttp/psr7": "^2",
37-
"php-mock/php-mock-phpunit": "^2.13",
34+
"behat/behat": "^3.15",
35+
"friendsofphp/php-cs-fixer": "^3.94",
36+
"guzzlehttp/psr7": "^2.8",
37+
"php-mock/php-mock-phpunit": "^2.15",
3838
"phpstan/phpstan": "^2.1",
39-
"phpunit/phpunit": "^9.5 || ^10.5 || ^11.2 || ^12.0.9",
39+
"phpunit/phpunit": "^9.6 || ^10.5 || ^11.5 || ^12.5 || ^13.0",
4040
"rector/rector": "^2.3"
4141
},
4242
"autoload": {
@@ -61,9 +61,9 @@
6161
],
6262
"behat": "behat --config tests/Behat/behat.yml",
6363
"codestyle": "php-cs-fixer fix",
64-
"coverage": "phpunit -c tests/phpunit-coverage.xml.dist --coverage-html=\".phpunit.cache/code-coverage\"",
64+
"coverage": "phpunit -c tests/phpunit-coverage.dist.xml --coverage-html=\".phpunit.cache/code-coverage\"",
6565
"phpstan": "phpstan analyze --memory-limit 512M --configuration .phpstan.neon",
66-
"phpunit": "phpunit -c phpunit.xml.dist",
66+
"phpunit": "phpunit -c phpunit.dist.xml",
6767
"rectify": [
6868
"@rector",
6969
"@codestyle"
@@ -72,6 +72,7 @@
7272
"test": [
7373
"@phpstan",
7474
"@phpunit",
75+
"@rector --dry-run",
7576
"@codestyle --dry-run --diff"
7677
]
7778
}

docker-compose.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
services:
2+
init-volumes:
3+
image: busybox
4+
user: "0"
5+
command: >
6+
sh -c "mkdir -p .docker/redmine-dev_data/files .docker/redmine-dev_data/sqlite
7+
.docker/redmine-60101_data/files .docker/redmine-60101_data/sqlite
8+
.docker/redmine-60008_data/files .docker/redmine-60008_data/sqlite
9+
.docker/redmine-50111_data/files .docker/redmine-50111_data/sqlite &&
10+
chmod -R 777 .docker/redmine-*_data/"
11+
volumes:
12+
- ./:/work
13+
working_dir: /work
14+
215
php:
316
build: # Info to build the Docker image
417
context: ./.docker # Specify where the Dockerfile is located (e.g. in the root directory of the project)
518
dockerfile: PHP74-Dockerfile # Specify the name of the Dockerfile
619
ports:
720
- 8111:80
821
depends_on:
22+
- init-volumes
923
- redmine-dev
10-
- redmine-6-1
11-
- redmine-6-0
12-
- redmine-5-1
1324
volumes:
1425
- ./:/var/www/project/ # Location of the project for php-fpm. Note this should be the same for NGINX.*
1526

@@ -27,6 +38,18 @@ services:
2738
- ./.docker/redmine-dev_data/files:/usr/src/redmine/files
2839
- ./.docker/redmine-dev_data/sqlite:/usr/src/redmine/sqlite
2940

41+
behat:
42+
build: # PHP container for Behat tests (needs Redmine services)
43+
context: ./.docker # Specify where the Dockerfile is located (e.g. in the root directory of the project)
44+
dockerfile: Behat-Dockerfile # Specify the name of the Dockerfile
45+
depends_on:
46+
- init-volumes
47+
- redmine-6-1
48+
- redmine-6-0
49+
- redmine-5-1
50+
volumes:
51+
- ./:/var/www/project/ # Location of the project for php-fpm. Note this should be the same for NGINX.*
52+
3053
# Make sure the following services are configured in:
3154
# - /tests/Behat/behat.yml
3255

File renamed without changes.

0 commit comments

Comments
 (0)