Skip to content

Commit 3a2a910

Browse files
committed
upgrades: upgrade project
1 parent 06e1e17 commit 3a2a910

12 files changed

Lines changed: 110 additions & 21 deletions

.docker/Dockerfile

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
1-
FROM splitbrain/phpfarm:jessie
1+
FROM debian:trixie-slim
22

3-
RUN apt-get update && apt-get install -y git zip
3+
# Prevent interactive prompts
4+
ENV DEBIAN_FRONTEND=noninteractive
45

6+
# Install dependencies
7+
RUN apt-get update && apt-get install -y \
8+
apt-transport-https \
9+
ca-certificates \
10+
curl \
11+
git \
12+
lsb-release \
13+
unzip \
14+
zip \
15+
&& curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg \
16+
&& echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \
17+
&& apt-get update
18+
19+
# Supported PHP Versions
20+
ENV PHP_VERSIONS="7.4 8.0 8.1 8.2 8.3 8.4 8.5"
21+
22+
# Install all PHP versions using a loop
23+
RUN for ver in $PHP_VERSIONS; do \
24+
apt-get install -y \
25+
php${ver}-cli php${ver}-xml php${ver}-mbstring php${ver}-soap; \
26+
done \
27+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
28+
29+
# Create symlinks (php-X.Y) using the same list
30+
RUN for ver in $PHP_VERSIONS; do \
31+
ln -s /usr/bin/php${ver} /usr/bin/php-${ver}; \
32+
done
33+
34+
# Install Composer
535
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
36+
37+
# Set working directory
38+
WORKDIR /var/www
39+
40+
# Copy project files
641
COPY . /var/www/
742

8-
WORKDIR /var/www/
43+
# Default command
44+
CMD ["bash"]
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
1-
name: SonarCloud
1+
name: Sonars
22
on:
33
push:
44
branches:
55
- develop
66
- feature/*
77
- feat/*
8+
- release/*
89
pull_request:
910
types: [ opened, synchronize, reopened ]
11+
concurrency: sonars
1012
jobs:
1113
sonarcloud:
12-
name: SonarCloud
14+
name: Sonars
1315
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
pull-requests: write
19+
statuses: write
1420
steps:
15-
- uses: actions/checkout@v2
21+
- name: Checkout code
22+
uses: actions/checkout@v3
1623
with:
1724
fetch-depth: 0
1825

1926
- name: Setup PHP with Xdebug
20-
uses: shivammathur/setup-php@v2
27+
uses: shivammathur/setup-php@v2.37.2
2128
with:
2229
php-version: 7.4
2330
coverage: xdebug
2431

2532
- name: Install dependencies with composer
2633
run: composer update --no-ansi --no-interaction --no-progress
2734

28-
- name: Generate coverage report with phpunit/phpunit
35+
- name: Generate coverage report with phpunit
2936
run: vendor/bin/phpunit --coverage-clover coverage.xml --log-junit report.xml
3037

38+
- name: Monitor coverage
39+
uses: slavcodev/coverage-monitor-action@v1
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
coverage_path: coverage.xml
43+
threshold_alert: 95
44+
threshold_warning: 90
45+
3146
- name: Fix phpunit files paths
3247
run: sed -i 's@'$GITHUB_WORKSPACE/'@''@g' coverage.xml report.xml
3348

3449
- name: SonarCloud Scan
35-
uses: SonarSource/sonarcloud-github-action@master
50+
uses: SonarSource/sonarqube-scan-action@v7
3651
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3753
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".docker"]
2+
path = .docker
3+
url = git@github.com:WsdlToPhp/DockerCommonImage.git

.php-cs-fixer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
->setUsingCache(false)
99
->setRules(array(
1010
'@PhpCsFixer' => true,
11+
'phpdoc_separation' => false,
12+
'single_line_empty_body' => false,
13+
'phpdoc_align' => false,
14+
'php_unit_test_class_requires_covers' => false,
1115
))
1216
->setFinder($finder);

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
PHP_VERSION ?= php-7.4
2+
CONTAINER_NAME ?= dom_handler
3+
COMPOSER ?= /usr/bin/composer
4+
DOCKER_COMPOSE ?= docker compose
5+
DOCKER_EXEC_CONTAINER ?= docker exec -t $(CONTAINER_NAME)
6+
7+
.PHONY: bash build cs-fixer down install phpstan phpunit rector up update
8+
9+
bash:
10+
$(DOCKER_EXEC_CONTAINER) bash
11+
12+
build:
13+
$(DOCKER_COMPOSE) build
14+
15+
cs-fixer:
16+
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/php-cs-fixer fix --ansi --diff --verbose
17+
18+
down:
19+
$(DOCKER_COMPOSE) down
20+
21+
install:
22+
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) $(COMPOSER) install
23+
24+
phpstan:
25+
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/phpstan analyze src --level=2
26+
27+
phpunit:
28+
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/phpunit --stop-on-failure --stop-on-error $(ARGS)
29+
30+
rector:
31+
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) vendor/bin/rector process
32+
33+
up:
34+
$(DOCKER_COMPOSE) up -d
35+
36+
update:
37+
$(DOCKER_EXEC_CONTAINER) $(PHP_VERSION) $(COMPOSER) update

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
{
2121
"name": "phordijk",
2222
"role": "Contributor"
23+
},
24+
{
25+
"name": "Andreas Allacher",
26+
"role": "Contributor"
2327
}
2428
],
2529
"require": {

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.4'
2-
31
services:
42
php:
53
build:
@@ -8,3 +6,4 @@ services:
86
volumes:
97
- .:/var/www:rw
108
container_name: dom_handler
9+
tty: true

tests/AttributeHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
/**
1010
* @internal
11-
*
12-
* @coversDefaultClass \WsdlToPhp\DomHandler\AttributeHandler
1311
*/
1412
final class AttributeHandlerTest extends TestCase
1513
{

tests/DomDocumentHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
/**
1212
* @internal
13-
*
14-
* @coversDefaultClass \WsdlToPhp\DomHandler\DomDocumentHandler
1513
*/
1614
final class DomDocumentHandlerTest extends TestCase
1715
{

tests/ElementHandlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
/**
1313
* @internal
14-
*
15-
* @coversDefaultClass \WsdlToPhp\DomHandler\ElementHandler
1614
*/
1715
final class ElementHandlerTest extends TestCase
1816
{

0 commit comments

Comments
 (0)