File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
535COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
36+
37+ # Set working directory
38+ WORKDIR /var/www
39+
40+ # Copy project files
641COPY . /var/www/
742
8- WORKDIR /var/www/
43+ # Default command
44+ CMD ["bash" ]
Original file line number Diff line number Diff line change 1- name : SonarCloud
1+ name : Sonars
22on :
33 push :
44 branches :
55 - develop
66 - feature/*
77 - feat/*
8+ - release/*
89 pull_request :
910 types : [ opened, synchronize, reopened ]
11+ concurrency : sonars
1012jobs :
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 }}
Original file line number Diff line number Diff line change 1+ [submodule ".docker "]
2+ path = .docker
3+ url = git@github.com:WsdlToPhp/DockerCommonImage.git
Original file line number Diff line number Diff line change 1+ PHP_VERSION ?= php-7.4
2+ CONTAINER_NAME ?= package_generator
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
Original file line number Diff line number Diff line change 2020 {
2121 "name" : " phordijk" ,
2222 "role" : " Contributor"
23+ },
24+ {
25+ "name" : " Andreas Allacher" ,
26+ "role" : " Contributor"
2327 }
2428 ],
2529 "require" : {
Original file line number Diff line number Diff line change 1- version : ' 3.4'
2-
31services :
42 php :
53 build :
@@ -8,3 +6,4 @@ services:
86 volumes :
97 - .:/var/www:rw
108 container_name : dom_handler
9+ tty : true
You can’t perform that action at this time.
0 commit comments